Re: [Boost-bugs] [Boost C++ Libraries] #11012: chrono_io v2 fail to compile with boost::chrono::duration< boost::rational<int> >

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11012: chrono_io v2 fail to compile with boost::chrono::duration< boost::rational<int> >
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-02-16 08:26:50


#11012: chrono_io v2 fail to compile with boost::chrono::duration<
boost::rational<int> >
--------------------------------------------------+----------------------
  Reporter: Sébastien Barthélémy <barthelemy@…> | Owner: viboes
      Type: Bugs | Status: assigned
 Milestone: To Be Determined | Component: chrono
   Version: Boost 1.57.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------------------------+----------------------

Comment (by Sébastien Barthélémy <barthelemy@…>):

 Hello Vicente,

 thank you for your answer.

 Replying to [comment:1 viboes]:
> Why do you want the following to compile?
>
> {{{
> boost::chrono::duration< boost::rational<int> >
> }}}

 Well, this specific line does compile, and even the io part did compile
 under version 1.
 The compilation only fails with io version 2.

 I expected the compilation not to break between versions.

 Moreover, the page {{{en.cppreference.com/w/cpp/chrono/duration}}}
 documents rep as:

> Rep, an arithmetic type representing the number of ticks

 I'm not sure what "arithmetic type" precisely means in this context, but
 using a rational type, which supports the arithmetic operations, seemed
 legit (and does actually work, except for io version 2).

 Note that I just discovered this trait class:
 {{{en.cppreference.com/w/cpp/types/is_arithmetic}}},
 maybe there is a precise definition of what an arithmetic type is
 somewhere in the standard.


 Replying to [comment:1 viboes]:
> duration expects an integral type.

 That seems untrue: there is explicit support for floating point numbers.


 I guess the crux here is to first understand whether or not std::chrono
 supports boost::rational-like types as Rep, and then support the same
 types for the io part.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11012#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC