#pragma once #include #include namespace bts { namespace utils { template class ValueWrapper { public: typedef ValueT Value; ValueWrapper() : _v() {} explicit ValueWrapper(ValueT const&v) : _v(v) {} explicit ValueWrapper (ValueT &&v) : _v (std::move(v)) {} ValueWrapper(ValueWrapper const&v) : _v (v._v) {} ValueWrapper(ValueWrapper &&v) : _v (std::move(v._v)) {} ValueWrapper &operator=(ValueWrapper const&v) {_v = v._v;return *this;} ValueWrapper &operator=(ValueWrapper &&v) {_v = std::move(v._v);return *this;} bool operator==(ValueWrapper const&v) const {return _v == v._v;} bool operator!=(ValueWrapper const&v) const {return _v != v._v;} bool operator<(ValueWrapper const&v) const {return _v < v._v;} bool operator>(ValueWrapper const&v) const {return _v > v._v;} ValueT const& value() const {return _v;} ValueT & value() {return _v;} private: ValueT _v; }; // don't ask. template std::ostream& operator<<(std::ostream &s, ValueWrapper const&v) { s << v.value(); return s; } }} namespace std { template struct hash> { std::size_t operator()(const bts::utils::ValueWrapper & k) const { return hash()(k.value()); } }; }