That will work. However a function local static requires the compiler to add a lot of overhead code in order to initialize the value in a thread-safe manner. By moving the 'static const' outside of the function you avoid all that extra work.