Friday, 9 December 2011

Using Boost Assign to initialise a list of a list.


std::list<std::list<int> > listOfListOfInts = list_of(list_of<int>(1)(2))
                                                     (list_of<int>(1)(2));
assert(listOfListOfInts.front().front() == 1);

Note that the inner lists need to the type hint. Visual Studio 2008 caused a compiler crash without it!

keywords for search: nest nested std stl list boost assign list_of initialise

Note: modern C++ has initialisation built in now.  Use {} for all initialisation.

Friday, 15 April 2011

The application failed to initialize properly 0x0000007b

Thanks Microsoft - what a helpful error message.

My little test application consisted of 3 projects one of which had the /clr switch. I removed that and it ran.

So if you get this error message I suggest you check all settings match.  If you get this error message in someone else's code then you probably have the wrong DLL and I can't help further.