[v3] constexpr time_point additions

Paolo Carlini paolo.carlini@oracle.com
Thu Jul 21 10:37:00 GMT 2011


Hi,
> This updates<chrono>  to N3291, and adds constexpr to time_point
> nonmember arithmetic operations, as pointed out to me in private email
> by Daniel Krugler. Indeed, they can become constant expressions: thanks!
Great.
> These additions are on top of N3229.
>
> tested x86/linux
Out of curiosity, did you also try building with 
--enable-libstdcxx-time=rt (the most complete option)? I tried now and 
the build breaks for me while building the pch, like the below. I'm not 
101% sure some of those issues aren't pre-existing, but I would really 
appreciate your help!

Thanks,
Paolo.

//////////////////

.../x86_64-unknown-linux-gnu/libstdc++-v3/include/mutex:215:13: error: 
‘monotonic_clock’ in namespace ‘std::chrono’ does not name a type
.../x86_64-unknown-linux-gnu/libstdc++-v3/include/mutex:293:45: error: 
wrong number of template arguments (1, should be 2)
.../x86_64-unknown-linux-gnu/libstdc++-v3/include/ratio:385:12: error: 
provided for ‘template<class _R1, class _R2> struct std::ratio_less_equal’
.../x86_64-unknown-linux-gnu/libstdc++-v3/include/mutex:293:59: error: 
template argument 1 is invalid
.../x86_64-unknown-linux-gnu/libstdc++-v3/include/mutex:304:46: error: 
wrong number of template arguments (1, should be 2)
.../x86_64-unknown-linux-gnu/libstdc++-v3/include/ratio:385:12: error: 
provided for ‘template<class _R1, class _R2> struct std::ratio_less_equal’
.../x86_64-unknown-linux-gnu/libstdc++-v3/include/mutex:304:60: error: 
template argument 1 is invalid
.../x86_64-unknown-linux-gnu/libstdc++-v3/include/mutex:305:73: error: 
‘template<class _Rep, class _Period> int 
std::timed_mutex::__try_lock_for_impl(const std::chrono::duration<_Rep, 
_Period>&)Â’ cannot be overloaded
.../x86_64-unknown-linux-gnu/libstdc++-v3/include/mutex:294:73: error: 
with ‘template<class _Rep, class _Period> int 
std::timed_mutex::__try_lock_for_impl(const std::chrono::duration<_Rep, 
_Period>&)Â’
.../x86_64-unknown-linux-gnu/libstdc++-v3/include/mutex: In member 
function ‘int std::timed_mutex::__try_lock_for_impl(const 
std::chrono::duration<_Rep, _Period>&)Â’:
.../x86_64-unknown-linux-gnu/libstdc++-v3/include/mutex:296:24: error: 
expected initializer before ‘__atime’
.../x86_64-unknown-linux-gnu/libstdc++-v3/include/mutex:299:24: error: 
‘__atime’ was not declared in this scope
...





More information about the Libstdc++ mailing list