bool f(int i) { return i != 5; } template struct Traits { typedef P type; }; template ::type> struct S { const P& p_; S( const P& p ) : p_(p) {} // const reference }; template S make_s(const typename Traits::type & p) // const reference { return S(p); // << HERE } int main() { make_s(f); }