Classic ‘auto’ problem, the default for auto’s is to act as a value type. However in this case you can’t use a value type because you aren’t allowed to instantiate an IAssetRegistry.
If you look at the return value of both of those functions, you’ll see that they return Something& which means a reference. So if you change both autos to auto& you will be creating and initializing references. Which will mean you won’t try to instantiate a type that you’re not allowed to.