You could also do : template< size_t N > constexpr size_t string_length(const char (&)[N] ) { return N-1; } On Wed, Jun 14, 2017 at 5:50 PM, Jesse Williamson <jwilliamson@xxxxxxx> wrote: > > > Here's a C++11 version that might be useful to you (largely untested, > and I'm only on my first cup of coffee, so... ;>). > > -Jesse -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html