Subject: [Boost-bugs] [Boost C++ Libraries] #6501: BOOST_STRONG_TYPEDEF Unexpected result when performing an addition (and probably other type of operators) of two strongly typed variables.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-01-31 13:39:15
#6501: BOOST_STRONG_TYPEDEF Unexpected result when performing an addition (and
probably other type of operators) of two strongly typed variables.
-----------------------+----------------------------------------------------
Reporter: anonymous | Type: Bugs
Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.48.0
Severity: Problem | Keywords:
-----------------------+----------------------------------------------------
If you add two strongly typed variables of the same type result is not of
the typedef type but of the underlying type.
The example below will generate a compiler error which is unexpected as I
see it.
#include <boost/strong_typedef.hpp>
BOOST_STRONG_TYPEDEF(int, TypedInt)
int main()
{
TypedInt x(10);
TypedInt y(20);
TypedInt z = x + y;
return 0;
}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6501> 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:08 UTC