Sign in to follow this  
ogl5

overloaded type cast functions

Recommended Posts

I was just wondering if overloaded type cast functions must always be member functions of some class in C++.

Share this post


Link to post
Share on other sites
Correct, you cannot create implicit conversions for built-in->built-in types (you could create a single-parameter non-explicit constructor to convert from a built-in to a class type, though), and cast functions must be class members.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this