[Boost-bugs] [Boost C++ Libraries] #13583: quantities can be assigned from cmath sqrt result, but not initialized

Subject: [Boost-bugs] [Boost C++ Libraries] #13583: quantities can be assigned from cmath sqrt result, but not initialized
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-05-30 21:33:28


#13583: quantities can be assigned from cmath sqrt result, but not initialized
------------------------------+------------------------------
 Reporter: edaskel@… | Owner: Matthias Schabel
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: units
  Version: Boost 1.67.0 | Severity: Problem
 Keywords: |
------------------------------+------------------------------
 The cmath functions are very helpful in letting me perform math on
 quantities, but I ran across an inconsistency. Code like:

 {{{
     quantity<wavenumber, float> x, y;
     quantity<wavenumber, float> foo = sqrt(x*x + y*y);
 }}}

 fails to compile (with an "error: conversion from..."). The workaround is
 to use an assignment instead:

 {{{
     quantity<wavenumber, float> foo;
     foo = sqrt(x*x + y*y);
 }}}

 It seems odd to have this restriction (and it's certainly undocumented) so
 I suspect it is a bug.

-- 
Ticket URL: <https://svn.boost.org/trac10/ticket/13583>
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 : 2018-05-30 21:38:53 UTC