Community
cancel
Showing results for 
Search instead for 
Did you mean: 
vpozdyayev
Beginner
93 Views

lambda to std::function conversion issues

Hello.
I was wondering if the following is a known issue and/or has a workaround. This code fails to compile when any of the problematic lines is uncommented (error messages are provided in comments):
#include 

template< typename some_type >
class some_class {
public:
	void fn1() {
		auto qwe = [](){};
		auto asd = ( std::function< void() > )qwe;
	}
	static void fn2() {
		auto qwe = [](){};
		auto asd = ( std::function< void() > )qwe;
	}
	void fn3( std::function< void() > f ) {
		std::function< void() > _f = (){f();};
	}
	void fn4( const std::function< void() > &f ) {
		std::function< void() > _f = (){f();};
	}
};

int main() {
	some_class x;
	// uncomment any of the followings 4 lines:
	x.fn1(); // internal error: backend signals
	//some_class::fn2(); // internal error: backend signals
	//x.fn3( [](){} ); // internal error: type_pointed_to: not a pointer type
	//x.fn4( [](){} ); // internal error: backend signals
	return 0;
}
This also fails:
class some_non_template_class {
public:
	void fn3( std::function< void() > f ) {
		std::function< void() > _f = (){f();}; // internal error: type_pointed_to: not a pointer type
	}
};
Versions:
Intel C++ Compiler XE for applications running on IA-32, Version 12.1.2.278 Build 20111128;
MSVS 2010 SP1 (MSVC compiles this just fine).
Have tried compiling from IDE, and also with just "icl main.cpp"
----
Vladimir
0 Kudos
4 Replies
Georg_Z_Intel
Employee
93 Views

Hello Vladimir,

all the errors you see (named internal error) are compiler defects. I've submitted a defect (edit: DPD200177954) to our engineers to fix this. I'm also asking them for workarounds and come back to you as soon as I have more information.

Sorry for the inconvenience & best regards,

Georg Zitzlsberger
tehpikachu
Beginner
93 Views

my sig
Thanks a lot, had a similar problem myself was wondering what was going on.
vpozdyayev
Beginner
93 Views

Thank you, Georg.
Georg_Z_Intel
Employee
93 Views

Hello,

those internal compiler errors just got fixed and will be available with Intel Composer XE 2011 Update 10.

Best regards,

Georg Zitzlsberger
Reply