Python to c++ conversion problem
jcoffin at taeus.com
Wed Mar 23 17:12:16 CET 2005
Akdes Serin wrote:
> I have a code in python like
> if eval('player.moveRoom(SeLinuxMud.Direction.' + x + ')'): #
> function takes Direction enum as a parameter
> When I am trying to write this code in c++
> if (player->moveRoom(s)) //s is a string so it outputs an error
> because of not taking enum as a parameter
> How can I change string to enum in c++?
The most obvious way would be to use an std::map of strings and the
enum that's equivalent to each.
The universe is a figment of its own imagination.
More information about the Python-list