Wrapper<int>

joboc
13.4K views
undefined

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content
template<typename T>
class Wrapper
{
public:
Wrapper(T const& value) : value_(value) {}
T const& get() const { return value_; }
private:
T value_;
};
int main()
{
using IntWrapper = Wrapper<int>;
int a = 42;
IntWrapper intWrapper(a);
intWrapper.get() = 43;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content