STL containers element destruction order
Unspecified in the standard. Yes, but this means that the key is destroyed after its associated value.
Unspecified in the standard. Yes, but this means that the key is destroyed after its associated value.
You could use the following test to differentiate Octave from MATLAB: isOctave = exist(‘OCTAVE_VERSION’, ‘builtin’) ~= 0;
I’m no expert, but cppreference.com has what appears to me to be some pretty good information on volatile. Here’s the gist of it: Every access (both read and write) made through an lvalue expression of volatile-qualified type is considered an observable side effect for the purpose of optimization and is evaluated strictly according to the … Read more
I have found a simple how-to here, however, as I have not tested it myself, I cannot guarantee results. As usual YMMV. Quote from the original article (please follow the thread on the original article as well though): Mkbundle: bundle Mono with your applications Did you ever wonder why you need .NET Framework or Mono … Read more
learn to use the standard library read books (eg. this one) when you’re experienced, learn to use boost
There’s no way to set thread priorities via the C++11 library. I don’t think this is going to change in C++14, and my crystal ball is too hazy to comment on versions after that. In POSIX, pthread_setschedparam(thread.native_handle(), policy, {priority}); In Win32 BOOL SetThreadPriority(HANDLE hThread,int nPriority)
A method that is portable to most POSIX systems is: raise(SIGTRAP);
In C++14, you can mark a function as deprecated using the [[deprecated]] attribute (see section 7.6.5 [dcl.attr.deprecated]). The attribute-token deprecated can be used to mark names and entities whose use is still allowed, but is discouraged for some reason. For example, the following function foo is deprecated: [[deprecated]] void foo(int); It is possible to provide … Read more
As quoted from source (Creating the smallest possible PE executable): 1 Smallest possible PE file: 97 bytes Smallest possible PE file on Windows 2000: 133 bytes Smallest PE file that downloads a file over WebDAV and executes it: 133 bytes The files above are the smallest possible PE files due to requirements of the PE … Read more
It should be noted that MSVC uses the syntax: #pragma message ( “your warning text here” ) The usual #warning syntax generates a fatal error C1021: invalid preprocessor command ‘warning’ so it is not portable to those compilers.