[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Q about g++-3 and template instantiation



I'm the author of `gri' (gri.sourceforge.net), which is packaged in
Debian.  I'm porting gri to g++-3 in preparation to Debian's (and everyone
else's) eventual move to that compiler and I'm having some problems.
Perhaps someone on this list could help?  I hope it's not rude of me to be
asking this here, but perhaps asking the question will help others in the
Debian project.  My question is below.

Attached is a 6-line C++ test program (which does nothing more than
instantiate templates) that compiles in g++-2, with

        g++ -c test-template.cc

but for which g++-3 yields the error messages:

        test-template.cc:4: non-template used as template
        test-template.cc:6: non-template used as template

QUESTION: am I doing something wrong?

Dan E. Kelley                                     phone:(902)494-1694
Oceanography Department, Dalhousie University       fax:(902)494-2885
Halifax, Nova Scotia                         mailto:Dan.Kelley@Dal.CA
Canada B3H 4J1   http://www.phys.ocean.dal.ca/~kelley/Kelley_Dan.html
#include <vector>
#include <algorithm>

template void std::reverse(std::vector<double>::iterator, std::vector<double>::iterator);

template void std::sort(std::vector<double>::iterator, std::vector<double>::iterator);

Reply to: