- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#include "stdafx.h"
#include
#include
#include
#include
#include
using namespace std;
namespace NS1 {
class Dispatcher {
public:
void Dispatch(function
};
void Dispatcher::Dispatch(function
{
inFunction();
}
}
class SomeClass {
public:
void Pass(int i) { cout << i << endl; }
};
namespace N2 {
class Interior {
public:
Interior() : mSomeClass(new SomeClass) {}
void DoSomething();
void DoSomethingWithAnInt(int i);
private:
unique_ptr
};
void Interior::DoSomething()
{
NS1::Dispatcher theDispatcher;
vector
for (int i = 0; i < 10; ++i)
v.push_back(i);
theDispatcher.Dispatch([=](){
for_each(v.begin(), v.end(), [=](int i){
DoSomethingWithAnInt(i);
});
});
}
void Interior::DoSomethingWithAnInt(int i)
{
mSomeClass->Pass(i);
}
}
int _tmain(int argc, _TCHAR* argv[])
{
cout << "Hello World." << endl;
N2::Interior theInterior;
theInterior.DoSomething();
return 0;
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for reporting this finding. I was able to reproduce it and filed a defect ticket for engineering (DPD200285602). As soon as I learn more I'll let you know.
As workaround I only can offer you to use capture by reference (theDispatcher.Dispatch([&](){...); at least it would fit to your example.
Best regards,
Georg Zitzlsberger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
this problem has been fixed for the next update release, Intel Composer XE 2011 Update 12.
Best regards,
Georg Zitzlsberger

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page