Previous projects have been useful in C + + code to delete functions ...
1 namespaceFramework2 { 3 classUtils Final4 {5 Private:6Utils () = delete;//Delete a function7 Public:8 9 //--------Ten //Math One //-------- A - //returns unrestricted random number, maximum 0x7fffffff -InlineStatic intrandom (); the - //returns the specified range of random numbers (range [Start, end]) -InlineStatic intRandomintMinintmax); - + //Rounding rounding values, supporting negative numbers -InlineStatic DoubleRoundDoubleNumber ); + }; A}
As the code above, when a function is assigned to delete, the function is declared in order to delete the function, that is, it cannot be called. The parameterless constructor at the moment is declared as a delete function, which means that the system does not automatically generate constructors for this class, so the object of the class cannot be produced when externally used. The reason for this is because all the member functions of this class are declared for static methods, so there is no need to produce objects of that class, then force the user to not produce the object ...
A little problem with C + + DELETE function