File size: 415 Bytes
d1be154 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #ifndef OT_UTILITY_LAMBDA_HPP_
#define OT_UTILITY_LAMBDA_HPP_
namespace ot {
template <typename T>
struct CopyOnMove {
CopyOnMove(T&& rhs) : object(std::move(rhs)) {}
CopyOnMove(const CopyOnMove& other) : object(std::move(other.object)) {}
T& get() { return object; }
mutable T object;
};
}; // end of namespace ot. -----------------------------------------------------------------------
#endif
|