cx_streq.hpp 689 B

123456789101112131415161718192021222324252627282930
  1. #ifndef BOOST_DESCRIBE_DETAIL_CX_STREQ_HPP_INCLUDED
  2. #define BOOST_DESCRIBE_DETAIL_CX_STREQ_HPP_INCLUDED
  3. // Copyright 2021 Peter Dimov
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // https://www.boost.org/LICENSE_1_0.txt
  6. #include <boost/describe/detail/config.hpp>
  7. #if defined(BOOST_DESCRIBE_CXX11)
  8. namespace boost
  9. {
  10. namespace describe
  11. {
  12. namespace detail
  13. {
  14. constexpr bool cx_streq( char const * s1, char const * s2 )
  15. {
  16. return s1[0] == s2[0] && ( s1[0] == 0 || cx_streq( s1 + 1, s2 + 1 ) );
  17. }
  18. } // namespace detail
  19. } // namespace describe
  20. } // namespace boost
  21. #endif // defined(BOOST_DESCRIBE_CXX11)
  22. #endif // #ifndef BOOST_DESCRIBE_DETAIL_CX_STREQ_HPP_INCLUDED