Ad
  • Custom User Avatar

    what would you say about my solution? I joined late and I'm trying to get some appreciation :P

  • Custom User Avatar

    The main disadvantage of a std::map is that--if not a constexpr--has program startup initialization overhead whereas case statements are purely pay-for-play. It also has a slightly larger memory footprint than a case statement which, as noted, typically are encoded into efficient lookup tables. But, as always, profile the code if it's a bottleneck.

  • Default User Avatar

    Map seems useful, just learnt about it. Is it that slow? Also do you have idea wheter std :: string.find() is quicker than a switch statement?