Got an issue with the Emplace() function

When I declare my GetValidWords() function as const, I got an error on the Emplace() function. But it works fine if I dont declare it as const.

Is the someone that can explain me why is it so ?

Thank you.

You have made ValidWords a member variable. Emplace modifies the array by emplacing a new element. As such your member function can’t be const.

Of course, it’s so obvious now you say so :wink:

Thank’s

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms