- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
<class T>
function<void ()> test() { return [] () {}; }
int main(int argc, _TCHAR* argv[])
{
test<int>();
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The test case you wrote above is illegal since you the function class was never declared.
Inboth 11.1 and 12.0on Windows I see this validerror:
!% icl /Qstd=c++0x -c t.cpp
Intel C++ Compiler XE for applications running on IA-32, Version 12.0 Beta Bu
ild x
Built Mar 29 2011 23:08:17 by jward4 on JWARD4-DESK in D:/workspaces/12_0cfe/dev
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
t.cpp
t.cpp(3): error: expected a declaration
^
t.cpp(11): warning #12: parsing restarts here after previous syntax error
compilation aborted for t.cpp (code 2)
Please provide more details, like what version of the compiler you are using and what the actual code looks like. I know there were some lambda bugs in version 11.1 but I don't know of any in 12.0.
thanks
Judy
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page