I am stuck with this code and don't understand the error. I'm trying to make a forward declaration of template specialization in a header and then define this specialization in a source file. When I try to include this header, compiler complains that I'm using incomplete type.  Error:   $ error: invalid use of incomplete type 'A_Template&lt;Stub *&gt;'   std::cout &lt;&lt; A_Template&lt;Stub*&gt;().int_method() &lt;&lt; std::endl;                ^~~~~~~~~~~~~~~~~~~ $ note: forward declaration of 'A_Template&lt;Stub *&gt;' struct A_Template&lt;Stub*&gt;;        ^   /* a.h */ #pragma once template &lt;class T&gt; struct A_Template{};  class Stub{};  template&lt;&gt; struct A_Template&lt;Stub*&gt;;   /* a.cpp */ #include "a.h"  template&lt;&gt; struct A_Template&lt;Stub*&gt; {     int int_method() {return 42;} };   /* main.cpp */ #include &lt;iostream&gt; #include "a.h"  int main() {         std::cout &lt;&lt; A_Template&lt;Stub*&gt;().int_method();     return 0; }   Can anyone tell me what is wrong and is there a way to fix it?
Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)
Varnish cache with Nginx SSL termination How can I use varnish cache with nginx SSL termination for my SSL-Only (Https only) website? I use ubuntu 18.04 and I am currently running a wordpress site on my server. Find all Facebook comments on external websites Is there any way to find all comments on external websites connected with a Facebook account? Let's say I want to find all my Facebook activity on external pages based on profile URL; is there any way to do this? Left ideals of $M_n(K)$ Why do circuits work so fast? Drift velocity (explained to me as how fast the electrons are moving) is really slow. My book says the electrons move at around 10 mm/ s.  If electrons move so slowly how do circuits work so fast? If you make a basic circuit with just a light bulb, the bulb lights up almost immediately after you connect the wire to the positive terminal. Do these leaves signify anything? How to make a disk image and restore from it later? Is the latest version of Ubuntu 100% FREE How should I submit bug reports and feature requests? Inspired by  I became curious about what is the current preferred mechanism for submitting bug reports and feature requests to Apple. I'm aware that they have the internal RDAR bug tracking system, and that there is an  project to crowdsource the tracking of issues, but I'm at a loss as to the preferred channel to submit something.    Is there a public-facing portal for submitting issues? How do you performance test JavaScript code? In Ubuntu 18.04, when moving the windows there is a resize effect that occurs when accidentally touching one of the screen edges.  This control was available in CCSM and Ubuntu Tweak in previous versions with Unity.  I'm not finding it in GNOME Tweaks.  I also searched the repository with:  apt search ubuntu.*tweak Can the preposition 'in' be omitted here? How can I import a .c4d static model (Cinema 4d) on Blender? Is there any plugin could help me? I didn't notice anything on Internet. Separator between command list and } I have a problem. I am going to make a minecraft animation in blender. But when I put a minecraft texture on a 3d cube that is 16x16x16 it is very low resolution is there a way to get the texture in a better resolution or is there a way to make blender make the texture better?  I hope you have an answer. Thanks in advance how many linearly independed vectors combinations may I extract from a set of vectors Consider the set of $n$ vectors $\mathcal{S}=\{v_1,v_2,\dots,v_n\}$, with $v_i \in \mathbb{R}^n$. Let that set generate a subspace $\mathbb{V}$ of $\mathbb{R}^n$ of dimension $r\le n$. How many different unordered basis of  $\mathbb{V}$ may be constructed by picking up $r$ vectors from $\mathcal{S}$. There is a method to find them? How do I remove the file suffix and path portion from a path string in Bash? Given a string file path such as /foo/fizzbuzz.bar, how would I use bash to extract just the fizzbuzz portion of said string? In C#/VB.NET/.NET, which loop runs faster, for or foreach?  Ever since I read that a for loop works faster than a foreach loop a  I assumed it stood true for all collections, generic collections, all arrays, etc.  I scoured Google and found a few articles, but most of them are inconclusive (read comments on the articles) and open ended.  What would be ideal is to have each scenario listed and the best solution for the same.  For example (just an example of how it should be):   for iterating an array of 1000+ strings - for is better than foreach for iterating over IList (non generic) strings - foreach is better than for   A few references found on the web for the same:               [Edit]  Apart from the readability aspect of it, I am really interested in facts and figures. There are applications where the last mile of performance optimization squeezed do matter. How do I get a Ralink RT3290 wireless card working? The Definitive C++ Book Guide and List This question attempts to collect the few pearls among the dozens of bad C++ books that are published every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a well-written C++ book. It is way too big and complex for doing this. In fact, it is so big and complex, that there are very many very bad C++ books out there. And we are not talking about bad style, but things like sporting glaringly obvious factual errors and promoting abysmally bad programming styles. Please edit the accepted answer to provide quality books and an approximate skill level — preferably after discussing your addition in . (The regulars might mercilessly undo your work if they disagree with a recommendation.) Add a short blurb/description about each book that you have personally read/benefited from. Feel free to debate quality, headings, etc. Books that meet the criteria will be added to the list.  Books that have reviews by the Association of C and C++ Users (ACCU) have links to the review. *Note: FAQs and other resources can be found in the  and under . How do I format a String in an email so Outlook will print the line breaks? I'm trying to send an email in Java but when I read the body of the email in Outlook, it's gotten rid of all my linebreaks. I'm putting \n at the ends of the lines but is there something special I need to do other than that? The receivers are always going to be using Outlook.   I found a page on microsoft.com that says there's a 'Remove line breaks' "feature" in Outlook so does this mean there's no solution to get around that other than un-checking that setting?  Thanks