0
Can a double colon operator(scope resolution operator) be used to define functions other than in classes?
(yes/no) Please post the explanation too.
1 Antwort
+ 1
Yes u can use a scope resolution operator to define a class function. Many times it is preffered to do so because of the basic difference it make.
When we define the function within the class then its an Inline Function but on the other hand when we define it outside the class using scope resolution, it does not remain Inline anymore. For larger functions its better to not be inline as it makes it slow at runtime.
I hope it helps!