Re: Clang does not like constexpression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 16 Jun 2017, Willem Jan Withagen wrote:

Let me resurrect this discussion once more:
// specializations for char*/const char* use strlen()
template <>
struct string_traits<const char*> {
 static constexpr size_t size(const char* s) { return std::strlen(s); }
};

Not the most elegant of solutions, but see if this works for you:

namespace ceph {
namespace util {

constexpr size_t strlen(const char *s)
{
#if __clang__
 return __builtin_strlen(s);
#else
 return std::strlen(s);
#endif
}

}} // namespace ceph::util

...and make the above call to ceph::util::strlen().

-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



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux