
The following example doesn't compile under VC7.1 and VC8.0b2: [code] #include <boost/assign/list_of.hpp> #include <boost/assert.hpp> #include <map> using namespace std; template<class T> void func1() { } template<class T> void func2() { } void func() { } int _tmain(int argc, _TCHAR* argv[]) { typedef void (*TFunc)(); map<const wchar_t *, TFunc> next = boost::assign::map_list_of<const wchar_t *, TFunc> (L"test1", &func1<char>) (L"test2", &func2<char>) ; } [/code] But if I replace (L"test2", &func2<char>) with (L"test2", &func) or (std::make_pair(L"test2", &func2<char>)) then everything works fine.

Nevermind, it's a compiler bug. Obviously, there should be no difference between passing pointer to regular function and to an instance of templated function.
participants (2)
-
Alexey Bakhvalov
-
Thorsten Ottosen