operator<< for gregorian::date_duration not found
The operator<< for boost::gregorian::date_duration (aka
gregorian::days) is not found by name lookup. This
appears to be because:
* boost::gregorian::date_duration is a typedef to:
boost::date_time::date_duration<
boost::gregorian::date_duration_rep >
where boost::gregorian::date_duration_rep is a
typedef to boost::date_time::duration_traits_adapted
(defined in date_time/gregorian/greg_duration.hpp)
* operator<< for boost::gregorian::date_duration) is
defined in the gregorian namespace
(defined in date_time/gregorian/gregorian_io.hpp)
However, since only the typedef names are in the
gregorian namespace, argument-dependent lookup doesn't
find it there unless you add:
using gregorian::operator<<;
to your code, after which the operator works as expected.
This occurs for me using both gcc 3.4.5 and 4.0.3, and
both with Boost 1.33.1 and current CVS trunk.
A possible solution would be to either move the
definition of operator<< to the date_time namespace, or
pull it into that namespace with a using declaration.
I haven't checked all the other gregorian types, but
it's possible that similer problems exist.
Change History
(3)
Severity: |
Showstopper → Problem
|
Resolution: |
None → fixed
|
Status: |
assigned → closed
|
This is fixed in trunk now. The fix will go in 1.38 release. However, the similar problem may still be present for other gregorian types. This will have to be checked.