date_time test questions

Jeff, I've been playing with date_time to try and get it to do the right thing with VC++ when /Zc:wchar_t is *not* specified, and I've come up with a list of questions for you if you don't mind :-) 1) What's the meaning of USE_DATE_TIME_PRE_1_33_FACET_IO? Without it the testtime_wstream.cpp test case fails even with /Zc:wchar_t, this is a source of confusion if you're building the building the tests in your IDE for whatever reason. 2) Without USE_DATE_TIME_PRE_1_33_FACET_IO the testgrep_wstream.cpp test doesn't compile irrespective of the /Zc:wchar_t option: testgreg_wstream.cpp c:\data\boost\develop\boost\boost\date_time\date_facet.hpp(640) : error C2678: binary '+' : no operator found which takes a left-hand operand of type 'const char [35]' (or there is no acceptable conversion) c:\data\boost\develop\boost\boost\date_time\date_facet.hpp(606) : while compiling class-template member function 'std::istreambuf_iterator<_Elem,_Traits> boost::date_time::date_input_facet<date_type,CharT>::get(InItrT &,InItrT &,std::ios_base &,boost::date_time::date_input_facet<date_type,CharT>::duration_type &) const' with [ _Elem=wchar_t, _Traits=std::char_traits<wchar_t>, date_type=boost::gregorian::date, CharT=wchar_t, InItrT=std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>> ] c:\data\boost\develop\boost\boost\date_time\gregorian\gregorian_io.hpp(78) : see reference to class template instantiation 'boost::date_time::date_input_facet<date_type,CharT>' being compiled with [ date_type=boost::gregorian::date, CharT=wchar_t ] c:\data\boost\develop\boost\libs\date_time\test\gregorian\testgreg_wstream.cpp(50) : see reference to function template instantiation 'std::basic_istream<_Elem,_Traits> &boost::gregorian::operator
3) Finally there are a lot of places where an unsigned short is written to or read from a stream: unfortunately the dinkumware lib treats these "as if" they were a wide character value, rather than an integer. Casting to unsigned int in these cases would fix that, but it's a horrid cludge, and I don't know what you might think about that! Thanks, John.

"John Maddock" <john@johnmaddock.co.uk> wrote in message news:006901c5acbd$7c3b61b0$2ef90352@fuji...
Jeff,
I can answer some of these...
With boost 1.33, date_time uses a totaly new system for streaming IO. We kept the pre 1.33 streaming code, and tests, in the library. That macro allows a person to choose which system they want to use. This is all in the documentation: http://tinyurl.com/cyu2d The old tests are dependant on the old code, therefore, they fail to compile when the macro is not defined. ...snip...
I'll let Jeff handle this one... Bart

On Tue, 30 Aug 2005 06:20:49 -0700, Bart wrote
"John Maddock" <john@johnmaddock.co.uk> wrote in message
I take it this only happens if you attempt to use a wide stream variant and has no effect on narrow stream i/o? If so, I'd argue that the user is selecting a 'invalid setup'. That is, using a wide stream with native wchar_t support turned off -- which then leads to the problem. Assuming this is all true, I'm reluctant to 'hack up' the library code to work around this. Seems like the compiler is telling the user something valuable... Jeff

On Tue, 30 Aug 2005 15:37:39 +0100, John Maddock wrote
Hmm, I thought we did that with all of the tests. There's this macro below: int main(){ #if defined(BOOST_NO_STD_WSTRING) || \ defined(BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS) check("No wstring/wstream support for this compiler", false); #else but apparently that's not taking effect in this case. Maybe we need an additional config settting here... Jeff
participants (3)
-
Bart
-
Jeff Garland
-
John Maddock