I have the next situation: //B.h class B {   template&lt;typename T&gt;   void b(T input); };  //B.cpp #include &quot;B.h&quot; template void B::b&lt;int&gt;(int); template void B::b&lt;float&gt;(float); template&lt;typename T&gt; void B::b(T input) {...}  //C.h // Because of constraints no B here, but B included in cpp file class C {   template&lt;typename T&gt;   void c(T&amp; obj);   int cInt; };  //C.cpp #include &quot;C.h&quot; #include &quot;B.h&quot; template void C::c&lt;B&gt;(B&amp;); template&lt;typename T&gt; void C::c(T&amp; obj) {obj.b(2);}  //main.h #include &quot;B.h&quot; #include &quot;C.h&quot; // ... B bo; C co; co.c(bo); // ...  I get LNK2019: Unresolved external symbol B::b(int) referenced in function C::c(B&amp;). Any ideas on how I could solve this?
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.)
'const int' vs. 'int const' as function parameters in C++ and C Consider:  int testfunc1 (const int a) {   return a; }  int testfunc2 (int const a) {   return a; }   Are these two functions the same in every aspect or is there a difference?  I'm interested in an answer for the C language, but if there is something interesting in the C++ language, I'd like to know as well. When getting a new credit card, what is the policy in regards to signing the strip on the back? Should I sign it? Should I write "See ID"? Should I leave it blank? Should I sign it AND write "See ID"?   I see all sorts of different advice but it seems like it's all based on urban legends, hearsay, or self interest (merchants and banks seem to advise you to do what's best for them, not what's best for the customer).  My question: For an average everyday consumer who uses a card fairly frequently, what is the best practice? What practice is most secure? Assigning values to divergent series I have been looking at divergent series on wikipedia and other sources and it seems people give finite "values" to specific ones. I understand that these values sometimes reflect the algebraic properties of the series in question, but do not actually represent what the series converges to, which is infinity. Why is it usefull to assign values to divergent series?  The only theory I could come up with, is this:  Say you have 2 divergent series, series' A and B, and you assign each a value,   Series ($A= \sum_{n=0}^\infty a_n$), which I assigned the value Q  and series ($B= \sum_{n=0}^\infty b_n$ ), which I assigned the value P  But it just so happens that series $C=A-B= \sum_{n=0}^\infty (a_n-b_n)$ converges. Could that imply that the actual value of series $C$ is the difference of the two assigned values to $A$ and $B$, that is $\sum_{n=0}^\infty (a_n-b_n)=Q-P$ ?  If so, then that would make some sense to me, as to why people sometimes assign values to divergent series. I've seen this message several times whenever someone has a problem installing, upgrading or removing some piece of software, but I wonder, what does it mean, and more importantly, is possible to solve it?  (Reading database ... 81657 files and directories currently installed.)  Removing mongodb-10gen ...  arg: remove  invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.  dpkg: error processing mongodb-10gen (--remove):   subprocess installed pre-removal script returned error exit status 100  invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.  dpkg: error while cleaning up:   subprocess installed post-installation script returned error exit status 100  Errors were encountered while processing:   mongodb-10gen  E: Sub-process /usr/bin/dpkg returned an error code (1)   (the above is just an example, not my actual problem) WinterBash site exhibits some strange 404 behavior I was poking around winterba.sh for secret hats and I figured there may be a secret hat linked to a URL so I decided to look at some different URLs and got plenty of 404s but, some pages throw different 404s than others. Why?  Example:  throws the classic "Page Not Found" winterbash style... but  just has the text "404"  ( used to throw just the text "404" but since that has changed)  Still happening at 2016 with . How do I opt-out of the Social Security system? How do I install Ubuntu from an USB drive / create a live USB-stick in Windows? Typesetting long division with tabular and overlining repeating part 2.81.16 No Rock Generator Can't see a glass object through another glass object in Eevee Random bits of my chat die and come back to life during the day The tennis statistics at the end of a set always show the number of winners and unforced errors of the players. But when does a point count as a winner and when as unforced error? Update to latest version of java after ppa is discontinued I have been trying to install the latest version of java-8. However, I found out that the  due to changes in the java licence.  How should I update my java to 8.0_201 or 8.0_211 now?  Thanks! Command line command to auto-kill a command after a certain amount of time I'd like to automatically kill a command after a certain amount of time.  I have in mind an interface like this:  % constrain 300 ./foo args   Which would run "./foo" with "args" but automatically kill it if it's still running after 5 minutes.  It might be useful to generalize the idea to other constraints, such as autokilling a process if it uses too much memory.  Are there any existing tools that do that, or has anyone written such a thing?  ADDED: Jonathan's solution is precisely what I had in mind and it works like a charm on linux, but I can't get it to work on Mac OSX.  I got rid of the SIGRTMIN which lets it compile fine, but the signal just doesn't get sent to the child process.  Anyone know how to make this work on Mac?  [Added: Note that an update is available from Jonathan that works on Mac and elsewhere.] Can compact sets completey determine a topology? Suppose that $\tau_1$ and $\tau_2$ are two topologies on a set $X$ with the property that $K\subset X$ is compact with respect to $\tau_1$ if and only if $K$ is compact with respect to $\tau_2$. Then is this enough information to determine whether $\tau_1 = \tau_2$?  If not (which is suspect to be the case) is there a nice counterexample, and what is the minimum amount of extra information required for $\tau_1 = \tau_2$?  I feel like there would be an issue regarding 'points at infinity.' UTF-8 all the way through I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2. How can I download free apps without registering an Apple ID? A diagram which is not the torus At page 17 of Munkres' Elements of Algebraic topology it says, referring to fig. 3.6, that "the diagram does not determine [the torus]. It does more than paste opposite edges together":   Is it so? I tried to glue them together, but end up with a normal torus. Does Airplane Mode allow GPS location to pass through? This is what I saw when my plane was taxing to the runway at CDG:     Airplane mode was on and all other transmissions (except Location), including WiFi, mobile data, NFC and Bluetooth were off.  Location was not manually turned on by me, after I enabled Airplane Mode. It remained turned on.  What am I missing? Is GPS now so widely accepted on-board planes that Android changed its configuration to let this kind of signal/communication to pass through Airplane mode "block"?  I believe that  isn't a duplicate, because at that time (2016) Location was generally "included" in Airplane mode and was turned off by enabling it. Evaluation of $$\sin \frac{\pi}{7}\cdot \sin \frac{2\pi}{7}\cdot \sin \frac{3\pi}{7} = $$   $\bf{My\; Try::}$ I have solved Using Direct formula::  $$\sin \frac{\pi}{n}\cdot \sin \frac{2\pi}{n}\cdot......\sin \frac{(n-1)\pi}{n} = \frac{n}{2^{n-1}}$$  Now Put $n=7\;,$ We get   $$\sin \frac{\pi}{7}\cdot \sin \frac{2\pi}{7}\cdot \sin \frac{3\pi}{7}\cdot \sin \frac{4\pi}{7}\cdot \sin \frac{5\pi}{7}\cdot \sin \frac{6\pi}{7}=\frac{7}{2^{7-1}}$$  So $$\sin \frac{\pi}{7}\cdot \sin \frac{2\pi}{7}\cdot \sin \frac{3\pi}{7} =\frac{\sqrt{7}}{8}$$  Now my question is how can we solve it without using Direct Formula, Help me  Thanks