id summary reporter owner description type status milestone component version severity resolution keywords cc 7160 BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG and DATE_TIME_NO_DEFAULT_CONSTRUCTOR Ricky Stoneback az_sw_dude "I think I found a couple issues that are somewhat related to one another: '''Issue 1 - Defining BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG and using the ptime default constructor along with a thread causes runtime crash''' Steps to reproduce: 1. Define BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG (to use nanosecond resolution in a posix_time) in the pre-processor definitions (VS2008). 2. Create a boost::posix_time::ptime using the default constructor. 3. Create a boost::thread and call join. Example: {{{ #include #include class ThreadClass { public: ThreadClass() { } void operator()() { return; } }; int main() { boost::posix_time::ptime currentTimeUTC; ThreadClass tc; boost::thread t(tc); t.join(); //causes a runtime access violation here std::cout << ""done"" << std::endl; system(""pause""); return 0; } }}} '''Issue 2 - defining DATE_TIME_NO_DEFAULT_CONSTRUCTOR causes compile-time error ""no appropriate default constructor available""''' In Issue 1 above, if you do not use a default constructor for a ptime, it seems to fix the issue. So I figured that was fine and I could prevent a user of my library from using that default constructor by defining DATE_TIME_NO_DEFAULT_CONSTRUCTOR. However, this now breaks at compile time: Steps to reproduce: 1. Use the same code as above, just for ease of use. 2. Define the pre-processor definition: DATE_TIME_NO_DEFAULT_CONSTRUCTOR. 3. Compile the program. 4. The following error is produced: error C2512: 'boost::posix_time::ptime' : no appropriate default constructor available e:\libraries\boost\boost_1_47\boost\thread\win32\thread_data.hpp 145 The issue, I believe, is that I am using a boost thread, which uses a ptime default constructor in its ''explicit timeout(sentinal_type)'' constructor when it doesn't set the ''abs_time'' member variable. I am using Boost 1.47, however looking at the latest boost code (1.51), I don't see any fixes for these issues that stand out (I am not able to try the latest versions of Boost, so I apologize if they are fixed, but I would think that they are not)" Bugs new To Be Determined date_time Boost 1.47.0 Problem thread, asio, ptime, posix_time