ratio: fix #5724: 0 + 0 and 0 - 0 lead to a compile time error

[SVN r73918]
This commit is contained in:
Vicente J. Botet Escriba 2011-08-19 15:40:42 +00:00
parent 81893a3fd7
commit e30305d13c
2 changed files with 12 additions and 0 deletions

View File

@ -20,6 +20,12 @@
void test()
{
{
typedef boost::ratio<0> R1;
typedef boost::ratio<0> R2;
typedef boost::ratio_add<R1, R2> R;
BOOST_RATIO_STATIC_ASSERT(R::num == 0 && R::den == 1, NOTHING, ());
}
{
typedef boost::ratio<1, 1> R1;
typedef boost::ratio<1, 1> R2;

View File

@ -21,6 +21,12 @@
void test()
{
{
typedef boost::ratio<0> R1;
typedef boost::ratio<0> R2;
typedef boost::ratio_subtract<R1, R2> R;
BOOST_RATIO_STATIC_ASSERT(R::num == 0 && R::den == 1, NOTHING, ());
}
{
typedef boost::ratio<1, 1> R1;
typedef boost::ratio<1, 1> R2;