Skip to content
  • Home
  • Archives
  • About Me

Vorbrodt's C++ Blog

Practical Modern C++

enum to string

Posted on January 28, 2019March 28, 2021 by Martin

A fellow engineer at work asked me today how to convert an enum to a string value. This is what I came up with:

shrink_to_fit that doesn’t suck

Posted on January 27, 2019March 28, 2021 by Martin

Lesson learned the hard way: trust the implementation to do the right thing! Everything else has been strikethrough’ed because my approach was flowed from the beginning. See the quoted comments at the bottom of this post.

Posts navigation

Newer posts

Me, elsewhere

  • Facebook
  • X
  • YouTube
  • LinkedIn
  • GitHub
  • Email

MY CORNER

  • Archives
  • About Me

Kobi’s Corner

  • San Diego C++ Meetup
  • Kobi’s Posts
  • About Kobi

C++ Online

  • Top 50 C++ Blogs
    • Awesome C++
    • Belay the C++
    • CppCast
    • C++ Core Guidelines
    • C++ Reference
    • C++ Stories
    • C++ Team Blog
    • Fluent { C++ }
    • foonathan::blog()
    • ISO C++ Blog
    • Meeting C++
    • Modernes C++
    • Sutter’s Mill

Top Posts

  • Fast mutex
  • Avoiding deadlocks the C++ way
  • {fmt}
  • enum to string, take 2
  • SSO of std::string

Subscribe via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 788 other subscribers

Admin

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Stats

  • 268,773 views
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

top
© 2025 Vorbrodt's C++ Blog
Theme: Techieblog by WP Crumbs