This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

egcs support for local classes as template arguments



>>>>> "Don" == Don Waugaman <dpw@cs.arizona.edu> writes:

    Don> When I try to compile the following program:

    Don> #include <algorithm> #include <list>

    Don> int main(int argc, char** argv) { class Test { public: void
    Don> operator()(int) { } ; };

    Don>     Test test_obj; list<int> test_list;

    Don>     for_each(test_list.begin(), test_list.end(), test_obj); }

    Don> egcs responds with:

    Don> tst.cc: In function `int main(int, char **)': tst.cc:18: type
    Don> `main(int, char **)::Test' composed from a local class is not
    Don> a valid template-argument

Yes, the standard forbids using a local class as a template argument.

-- 
Mark Mitchell		mmitchell@usa.net
Stanford University	http://www.stanford.edu



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]