snippet14.cpp 660 B

1234567891011121314151617181920212223242526
  1. // (C) Copyright Gennadiy Rozental 2001-2015.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. //
  6. // See http://www.boost.org/libs/test for the library home page.
  7. //
  8. //[snippet14
  9. class const_string {
  10. public:
  11. // Constructors
  12. const_string();
  13. const_string( std::string const& s )
  14. const_string( char const* s );
  15. const_string( char const* s, size_t length );
  16. const_string( char const* begin, char const* end );
  17. // Access methods
  18. char const* data() const;
  19. size_t length() const;
  20. bool is_empty() const;
  21. // ...
  22. };
  23. //]