> What does std::cout << _MSC_FULL_VER << '\n' ; print out?
> It prints 190023026
An integer made up of the major version, the minor version, and the build number of the compiler.
For instance,
190023026: major version is
19, minor version is
00, and build number is
23026.
https://msdn.microsoft.com/en-us/library/b0084kay.aspx
This is the C++ compiler that shipped with the original release of Visual Studio 2015.
It has subsequently been updated; with update 1, _MSC_FULL_VER would be
190023506 (build number
23506). With the updated compiler, the original code compiles cleanly.
http://rextester.com/BPK68326
Note: Update 2 has just been released.
https://www.visualstudio.com/en-us/news/vs2015-update2-vs.aspx
> periodic_repeat() repeatedly calls the function fn at periodic intervals.
>> Why though?
Well, the idea of
periodic_repeat() is to execute some piece of code at periodic intervals.
To merely block execution (wait), for say 15 seconds, this would suffice:
std::this_thread::sleep_for( std::chrono::seconds(15) ) ;
> This function or variable may be unsafe. Consider using ctime_s instead.
> To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
> So apparently ctime has been deprecated.
std::ctime() is
not deprecated; it is a standard library function.
It has some limitations:
This function returns a pointer to static data and is not thread-safe. In addition, it modifies the static std::tm object which may be shared with std::gmtime and std::localtime. POSIX marks this function obsolete and recommends std::strftime instead.
The behavior may be undefined for the values of time_t that result in the string longer than 25 characters (e.g. year 10000)
http://en.cppreference.com/w/cpp/chrono/c/ctime |
> Consider using ctime_s instead.
This is preposterous Microsoft nonsense.
If a more robust alternative is required, use the standard function
std::strftime()
More information:
http://www.cplusplus.com/forum/beginner/170947/