Template Dependencies II

 [Previous Chapter]  [Previous Page]  [Contents]  [Next Page]  [Next Chapter]

TemplateFailure.C
#include "History.h"

class Integer {
   public:
      Integer(int i) : integer(i) {};
   private:
      int integer;
};

int main() {
   History< Integer > integers(10);
}
dublin$ make 2>&1 | fold -sw 60
CC -g -xsb   -c  TemplateFailure.C
"/opt/SUNWspro/WS6U1/include/CC/Cstd/./vector", line 203:
Error: Could not find a match for Integer::Integer().
"History.C", line 11:     Where: While instantiating
"std::vector<Integer,
std::allocator<Integer>>::vector(unsigned)".
"History.C", line 11:     Where: Instantiated from
History<Integer>::History(int).
"TemplateFailure.C", line 11:     Where: Instantiated from
non-template code.
1 Error(s) detected.
*** Error code 1
make: Fatal error: Command failed for target
`TemplateFailure.o'
dublin$

 [Previous Chapter]  [Previous Page]  [Contents]  [Next Page]  [Next Chapter]
Copyright © 2001, 2002 Andreas Borchert, converted to HTML on February 21, 2002