cx_streq.hpp 679 B

123456789101112131415161718192021222324252627282930
  1. #ifndef BHO_DESCRIBE_DETAIL_CX_STREQ_HPP_INCLUDED
  2. #define BHO_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 <asio2/bho/describe/detail/config.hpp>
  7. #if defined(BHO_DESCRIBE_CXX11)
  8. namespace bho
  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 bho
  21. #endif // defined(BHO_DESCRIBE_CXX11)
  22. #endif // #ifndef BHO_DESCRIBE_DETAIL_CX_STREQ_HPP_INCLUDED