generic that wanted an initalizer function. was meant to be about "VS complains about adding the type in new()" buut I answered to the wrong comment, whoops
not even c#, visual studio or anyone wants you to do it this way or the other way
set up your .editorconfig as you like it and make warnings (or errors, if you prefer), style suggestions and refactoring suggestions to actually mean something
Actually those suggestions come from the Roslyn Analyzers made by the .NET team (the same things that provide intellisense). So you are in both technical and general senses correct in saying "that is what .NET wants".
auto record {std::make_unique<Record>(&Record::record)};
At first I thought you were passing a function to new, which looked kinda nuts. Gave me the idea to pass a pointer to a static member function in the object you're constructing into the constructor. Not exactly subtle in its ill-formed-ness.
Creates “record,” an object of type “Record,” which then stores an instance; that instance is created through a call of the Record() function, which creates an object, and that object’s function called “record()” is called, and it returns an instance of Record that is then stored.
2.6k
u/corner-case Aug 01 '22