Yes. Compared to Java, you need to decide whether you want to create it on the stack or on the heap. The former may have semantics of values (behaves as int-copy / moves as int, has no polymorphic behavior), while the latter will have reference semantics (refers to a single instance of an object, may behave polymorphically, copy by cloning). *
void ref( const X& x ) { x.do(); }
void ptr( const X* const x ) { x->do();}
void val( const X x ) { x.do(); }
int main()
{
ref( X{} );
ptr( new X{} );
val( X{} );
auto x = X{};
ref( x );
ptr( &x );
val( x );
auto p = std::make_unique<X>();
ref( *p );
ptr( p.get() );
val( *p );
}
* , . ., , CppCon17 . , , .