#include <iostream>
#include <type_traits>
using namespace std;
template <class T>
class I
{
public:
virtual auto write(const T&) -> typename std::enable_if<std::is_copy_constructible<T>::value>::type=0;
};
template <class T>
class J: public I<T>
{
public:
auto write(const T& p) -> typename std::enable_if<std::is_copy_constructible<T>::value>::type {
cout<<"write "<<p<<endl;
};
};
int main() {
J<int> x;
x.write(5);
//J<int&&> y;
//y.write(10)
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dHlwZV90cmFpdHM+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0ZW1wbGF0ZSA8Y2xhc3MgVD4KY2xhc3MgSQp7CnB1YmxpYzoKICAgIHZpcnR1YWwgYXV0byB3cml0ZShjb25zdCBUJikgLT4gdHlwZW5hbWUgc3RkOjplbmFibGVfaWY8c3RkOjppc19jb3B5X2NvbnN0cnVjdGlibGU8VD46OnZhbHVlPjo6dHlwZT0wOwp9OwoKdGVtcGxhdGUgPGNsYXNzIFQ+CmNsYXNzIEo6IHB1YmxpYyBJPFQ+CnsKcHVibGljOgogICAgYXV0byB3cml0ZShjb25zdCBUJiBwKSAtPiB0eXBlbmFtZSBzdGQ6OmVuYWJsZV9pZjxzdGQ6OmlzX2NvcHlfY29uc3RydWN0aWJsZTxUPjo6dmFsdWU+Ojp0eXBlIHsKICAgIAljb3V0PDwid3JpdGUgIjw8cDw8ZW5kbDsKICAgIH07Cn07CgoKaW50IG1haW4oKSB7CglKPGludD4geDsKCXgud3JpdGUoNSk7CgkvL0o8aW50JiY+IHk7CgkvL3kud3JpdGUoMTApCglyZXR1cm4gMDsKfQ==