I'm writing a wrapper class for a class of type inner_t. Can I call the proper constructor (lvalue reference or rvalue reference) for the inner class in the following way?
template<typename S, typename T>
struct u_ref {
};
template<typename S>
struct u_ref<S, const S&> {
typedef const S& type;
};
template<typename S>
struct u_ref<S, S&&> {
typedef S&& type;
};
class wrapper_t {
private:
inner_t data;
public:
template<typename T>
wrapper_t(typename u_ref<inner_t,T>::type c_data):
data(std::forward(c_data)) {
}
}