Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9356 for code


Ignore:
Timestamp:
Sep 1, 2012, 11:32:20 AM (12 years ago)
Author:
landauf
Message:

details

Location:
code/branches/testing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/testing/src/libraries/util/MultiType.h

    r9226 r9356  
    330330            /// Converts the current value to type T.
    331331            template <typename T> inline bool convert() { return this->force<T>(MultiType(*this)); }
    332 //            template <typename T> inline bool convert() { return this->force<T>(this->get<typename Loki::TypeTraits<T>::UnqualifiedReferredType>()); }
    333332
    334333            /// Resets value and type. Type will be void afterwards and null() returns true.
  • code/branches/testing/test/util/ConvertTest.cc

    r9114 r9356  
    9191        EXPECT_EQ('\n', multi_cast<char>(std::string("\n")));
    9292        EXPECT_EQ('\0', multi_cast<char>(std::string("")));
     93        EXPECT_EQ('1', multi_cast<char>(std::string("123")));
    9394
    9495        // bool
    9596        EXPECT_TRUE(multi_cast<bool>(std::string("true")));
    9697        EXPECT_FALSE(multi_cast<bool>(std::string("false")));
     98        EXPECT_FALSE(multi_cast<bool>(std::string("0")));
     99        EXPECT_FALSE(multi_cast<bool>(std::string("0.123")));
     100        EXPECT_TRUE(multi_cast<bool>(std::string("1")));
     101        EXPECT_TRUE(multi_cast<bool>(std::string("123.456")));
    97102
    98103        // TODO: Check consistency of conversion depending on MathConvert.h and reversibility
Note: See TracChangeset for help on using the changeset viewer.