SOLVED: See answer on the bottom  I'm rather new to C++ so this might be a stupid question, but I am trying to write a template class for vectors using the built in STL vectors. It is an assignment from the University. I created a Header file and a cpp-source file, so I can define the class Vector in the Header and declare it's functions in the source file. I get the following errors:  Vector.cpp:27:59: error: invalid use of incomplete type ‘class Vector&lt;T, n&gt;’ Vector&lt;T, n&gt;&amp; Vector&lt;T, n&gt;::operator=(const Vector&lt;U,n&gt;&amp; v){                                                            ^ In file included from Vector.cpp:1:0: Vector.h:5:7: note: declaration of ‘class Vector&lt;T, n&gt;’  class Vector {        ^~~~~~ Vector.cpp:42:59: error: invalid use of incomplete type ‘class Vector&lt;T, n&gt;’  Vector&lt;T, n&gt;&amp; Vector&lt;T, n&gt;::operator+(const Vector&lt;U,n&gt;&amp; v){                                                            ^ In file included from Vector.cpp:1:0: Vector.h:5:7: note: declaration of ‘class Vector&lt;T, n&gt;’  class Vector {        ^~~~~~   My code is this:  Header file (Vector.h):  #include &lt;vector&gt; using namespace std;  template &lt;class T, int n&gt; class Vector { public:     Vector();     Vector(int);     Vector(const Vector&lt;T, n&gt;&amp;);      ~Vector();      template&lt;class U&gt;     Vector&lt;T, n&gt; operator=(const Vector&lt;U, n&gt;&amp;);      T&amp; operator[](int i);      template&lt;class U&gt;     Vector&lt;T, n&gt; operator+(const Vector&lt;U, n&gt;&amp;);     template&lt;class U&gt;     Vector&lt;T, n&gt; operator-(const Vector&lt;U, n&gt;&amp;);     template&lt;class U&gt;     T operator*(const Vector&lt;U, n&gt;&amp;);      template&lt;class S&gt;     Vector&lt;T, n&gt; operator*(const S&amp;);    /*  template&lt;class S&gt;     friend Vector&lt;T, n&gt; operator*(const S&amp;, Vector&lt;T, n&gt;&amp;);*/      template&lt;class F&gt;     Vector&lt;T, n&gt; apply_Funktor();  private:     vector&lt;T&gt; values;     const int size; }; /* template&lt;class S, class T, int n&gt; Vector&lt;T, n&gt; operator*(const S&amp; s, const Vector&lt;T, n&gt; v){     return v * s; };*/   And the source-cpp file:  #include "Vector.h" #include &lt;vector&gt; using namespace std;  template &lt;class T, int n&gt; Vector&lt;T, n&gt;::Vector(): size(n){     vector&lt;T&gt; values; }  template &lt;class T, int n&gt; Vector&lt;T, n&gt;::Vector(int v): size(n){     vector&lt;T&gt; values;     values.assign(v, n); }  template &lt;class T, int n&gt; Vector&lt;T, n&gt;::Vector(const Vector&lt;T, n&gt;&amp; v): size(v.size){     values = v.values; }  template &lt;class T, int n&gt; Vector&lt;T, n&gt;::~Vector(){     delete values; }  template&lt;class U, class T, int n&gt; Vector&lt;T, n&gt;&amp; Vector&lt;T, n&gt;::operator=(const Vector&lt;U,n&gt;&amp; v){     delete values;     vector&lt;T&gt; values;     for(int i = 0; i &lt; size; i++){         values.push_back((T) v.values[i]);     }     return *this; }  template&lt;class T, int n&gt; T&amp; Vector&lt;T, n&gt;::operator[](int i){     return values[i]; }  template&lt;class U, class T, int n&gt; Vector&lt;T, n&gt;&amp; Vector&lt;T, n&gt;::operator+(const Vector&lt;U,n&gt;&amp; v){ //more Code to come but I already get the error here }   The error occurs when I try to build my project with NetBeans. I dont have a main yet to use the Vector. I already searched the internet for solutions but I didnt come across anything helpful. I learned about forward declaration but it seems to me that this isnt the case here, because Im including the header file.  Thank you for your help :)  !!!EDIT / SOLUTION: My tutor in class solved it: The problem is that instead of doing   template&lt;class U, class T, int n&gt;   I have to put it like this:  template&lt;class T, int n&gt; template&lt;class U&gt;
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.)
Drupal SA-CORE-2014-005 - How to tell if my server / sites were compromised? I just updated all my sites using the patch method of resolving the Drupal SA-CORE-2014-005 exploit. I just read reports that just yesterday there is someone from a Russian IP infiltrating drupal sites.     My main concerns are now:   How do I tell if my sites have been comprised? What should I search for in my apache access logs to detect if my site was a victim or not? So far what are these hackers doing to comprised sites? Prove that:  $$\displaystyle \sum_{n=m+1}^\infty \dfrac{1}{n!} \le \dfrac{1}{m\cdot m!}$$  I have tried induction on $m$ but it does not work very well. Any suggestion? True for every formula. For a formula $ \gamma = r \iff (p_1 \vee p_2) $ there is true that: $\rho \models \gamma \iff \rho(r) = \max(\rho(p_1), \rho(p_2))$  Is it a true for every formula r? Too many blanks between summation symbol and its associated expression Is it possible to access a 64-bit dll from a 32-bit application? Postgres : Relation does not exist error Union of connected subsets is connected if intersection is nonempty How to print line numbers to the log. Say when outputting some information to the log, I also want to print the line number where that output is in the source code. As we can see in the stack trace, it displays the line number where the exception has occurred. Stack trace is available on the exception object.  Other alternative could be like manually including the line number when printing to the log. Is there any other way? I'm really new in using biblatex, compile the sample placed in , but what I get is    1.1 Foo    Some text [B02x ].    1.2 Bar    Some text [B02y ].   Do not get the bibliography by chapters, or the global references.  Really not remains to be done   \documentclass{report}  \usepackage[style=alphabetic]{biblatex}  \addbibresource{references.bib}  \begin{document}  \chapter{First chapter}  \section{Foo}  Some text \cite{childs_temperature}.  \printbibliography  \chapter{Second chapter}  \section{Bar}  Some text \cite{hashemian}.  \printbibliography  \newpage  \printbibliography  \end{document}   And the references.bib    @BOOK{childs_temperature,   title = {Practical Temperature Measurement},   publisher = {Butterworth - Heinemann},   year = {2001},   author = {Childs, Peter R N},   address = {Great Britain},   edition = {1},   isbn = {0 7506 5080 X}   }    @PHDTHESIS{hashemian,   author = {Hashemian, Hashem Mehrdad},   title = {Measurements of dynamic temperatures and pressures in nuclear power plants},   school = {{The University of Western Ontario}},   year = {2011},   type = {PhD {T}hesis}   }   I need to obtain references by chapter and global cited references, but i don't know how compile. 1.7.4 Problem with mobs spawning I have just updated to Minecraft 1.7.4 and now all of a sudden there are barely any mobs spawning.  I checked to make sure that I was in normal difficult and I saw 1 creeper but that is all.  Also I tried different difficulties. Another thing - mobs seem to to spawn normally in the nether and all other mobs except aggressive mobs spawn like they should.  Please if you know how to fix this, please help! After installing Ubuntu 12.04 LTS on my HP Folio 13 I cannot get wireless to work. My kernel is 3.8.0-29-generic and my wireless module is a Broadcom BCM4313.  After running rfkill list all:  0: hp-wifi: Wireless LAN Soft blocked: no Hard blocked: no 1: hp-bluetooth: Bluetooth Soft blocked: no Hard blocked: no 2: hci0: Bluetooth Soft blocked: no Hard blocked: no   The wired connection works fine. The driver activation for Broadcom STA wireless driver fails every time. in the log it says  FATAL: Module wl not found. FATAL: Error running install command for wl   After running lspci -nnk | grep -iEA3 "(wireless|network|wlan)":  02:00.0 Network controller [0280]: Broadcom Corporation BCM4313 802.11bgn Wireless Network Adapter [14e4:4727] (rev 01) Subsystem: Hewlett-Packard Company Device [103c:1795] Kernel modules: bcma 03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5209 PCI Express Card Reader [10ec:5209] (rev 01)   I have also tried this method and it did not work: . Say, teamA score is 368 (369 to win), and teamB is batting at 368 (or 366). One run (or 3 runs) will make them win. The batsman hits the ball for a six, so score is 374 (or 372) which is more than the required 369. Even then the runs are counted for the team and for the batsman.  Now, on the last ball, suppose the batsman did not hit a six, but ran for a single : teamB will win. Can the batsmen continue to run until the ball is dead ?  Why will they want this ? (A) If batsman is at 98 and wants to reach a century. (B) If batsman has a career total of 9998 and wants to reach 1000 runs. (C) If the batsman has a very high record strike rate, and wants to remain at that record strike rate. (D) In the championship, this is the last quarterfinal, &amp; even winning will put teamB equal to teamC, and the better runrate at the end of the quarterfinals will enable them to move to the semifinals. (E) Many similar situations can happen.  So coming back to the question : Do the laws of cricket allow running on the last ball, even after winning ?  In most of the matches I have seen, after winning, the batsmen do not even look where the ball is and start celebrating the win. If the rules did not allow them to run more, then fine. If the rules did allow it, then has there been any game where they did run more ? This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, navigate to the  tag.  This question and answer is owned by the community! If you can improve it and make it more useful, you're welcome to edit it.  I have a specific JSON structure in mind. I need to either deserialize this structure that's coming in from a web service, or I need to serialize data into this structure to transmit it to another system. How should I get started on this project in Apex? Question about set notation: what does $]a,b[$ mean? In the following question  the notation $c\in ]a,b[$ is used. What does this mean? I have never seen it before. Make the chat link one click away in the new top bar single query to print all the rows whose count is greater than 10 Is -1 followed by a singular or plural noun? Is there a particle called a "tachyon" that can travel faster than light?  If so, would Einstein's relativity be wrong?  According to Einstein no particle can travel faster than light. Graph nodes coordinates evaluation Can I manually put an external hard disk to sleep?