Boost logo

Boost :

Subject: Re: [boost] VC14 CTP4 Atomic don't compile with boost::chrono durations which are not TriviallyCopyable
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2014-11-09 19:33:44


Le 07/11/14 00:32, Klaim - Joël Lamotte a écrit :
> I was testing my code with VC14 and found this issue.
> I'm just not sure what to do about it, should I consider it a bug of
> Boost.Chrono or not?
>
> This complete example does not compile in VC14 CTP4:
>
> #include <atomic>
> #include <boost/chrono.hpp>
>
> std::atomic<boost::chrono::milliseconds> ms; // error C2338: atomic<T>
> requires T to be trivially copyable.
>
>
> Using the standard library instead works as expected:
>
>
> #include <atomic>
> #include <chrono>
>
>
> std::atomic<std::chrono::milliseconds> ms; // no error
>
>
> The compiler is correct that boost::chrono::duration is not trivially
> copyable (as described on cppreference.com at least)
> but it seems (from looking at the code) that it's mostly concept check code
> used in
> constructors definitions that trigger the problem.
> So I'm not sure if it should be fixed or not or what to do with this info.
>
>
Hi,

please be free to create a ticket so that we don't forget it.
When we developed chrono, we don't had C++11 compilers.

Best,
Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk