Jump to content
  • Advertisement
Sign in to follow this  
jeff8j

c++ built in type overload operator=

This topic is 2108 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im working with gcc's built in type int128_t gcc doesnt work with integer constants that large so im trying to make them with strings. Whe I try to overload operator= I get "must be a nonstatic member function" it seems like it has to be part of the class but being that the int128_t is part of gcc I dont want to mess with it directly is there another way besides making it a different function I would like to be able to use the = operator

Share this post


Link to post
Share on other sites
Advertisement

If you're using a version of gcc that supports C++11 then you might want to consider using user defined literals rather than trying to modify operator=.

Share this post


Link to post
Share on other sites

Unfortunately c++11 isnt available on all the platforms this project is for so im left with little choices

Share this post


Link to post
Share on other sites

I didn't try, but should'nt you be able to do it like this?

static const int128_t whatever=(int128_t(0xfedcba9876543210LL)<<64)+0x0123456789abcdefLL;

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!