diff --git a/src/lib/null-value.hpp b/src/lib/null-value.hpp index c5220cf1e..d22a40a3d 100644 --- a/src/lib/null-value.hpp +++ b/src/lib/null-value.hpp @@ -81,7 +81,7 @@ namespace lib { static TY& build (void* storage) { - new(storage) TY{}; + return *new(storage) TY{}; } }; diff --git a/src/lib/replaceable-item.hpp b/src/lib/replaceable-item.hpp index d1da820bd..8894f5522 100644 --- a/src/lib/replaceable-item.hpp +++ b/src/lib/replaceable-item.hpp @@ -97,7 +97,7 @@ namespace wrapper { } operator X const&() const { - return access(); + return unConst(this)->access(); } X& get() { return access(); } @@ -105,7 +105,7 @@ namespace wrapper { private: X& - access() const + access() { return reinterpret_cast(content_); } diff --git a/tests/library/replaceable-item-test.cpp b/tests/library/replaceable-item-test.cpp index 31e4ac596..61375971b 100644 --- a/tests/library/replaceable-item-test.cpp +++ b/tests/library/replaceable-item-test.cpp @@ -25,6 +25,7 @@ #include "lib/test/run.hpp" #include "lib/test/test-helper.hpp" #include "lib/util.hpp" +#include "lib/time/timevalue.hpp" #include "lib/format-cout.hpp"////////////TODO #include "lib/replaceable-item.hpp" @@ -43,11 +44,13 @@ namespace test{ using ::Test; using lib::test::randStr; - using lib::test::showSizeof; + using lib::test::randTime; using util::isSameObject; - using std::ref; - using std::vector; + using time::Time; + using time::Duration; +// using std::ref; +// using std::vector; using std::string; using std::rand; @@ -101,14 +104,12 @@ namespace test{ string s2 (randStr(50)); const char* cp (s1.c_str()); - cout << std::boolalpha << is_assignable_value::value <::value <::value <::value <::value < (l1, l2); + verifyWrapper