File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88#ifndef CATCH_STRINGREF_HPP_INCLUDED
99#define CATCH_STRINGREF_HPP_INCLUDED
1010
11+ #include < catch2/internal/catch_lifetimebound.hpp>
12+
1113#include < cstddef>
1214#include < string>
1315#include < iosfwd>
1416#include < cassert>
15-
1617#include < cstring>
1718
1819namespace Catch {
@@ -36,14 +37,16 @@ namespace Catch {
3637 public: // construction
3738 constexpr StringRef () noexcept = default;
3839
39- StringRef ( char const * rawChars ) noexcept ;
40+ StringRef ( char const * rawChars CATCH_ATTR_LIFETIMEBOUND ) noexcept ;
4041
41- constexpr StringRef ( char const * rawChars, size_type size ) noexcept
42+ constexpr StringRef ( char const * rawChars CATCH_ATTR_LIFETIMEBOUND ,
43+ size_type size ) noexcept
4244 : m_start( rawChars ),
4345 m_size( size )
4446 {}
4547
46- StringRef ( std::string const & stdString ) noexcept
48+ StringRef (
49+ std::string const & stdString CATCH_ATTR_LIFETIMEBOUND ) noexcept
4750 : m_start( stdString.c_str() ),
4851 m_size ( stdString.size() )
4952 {}
@@ -89,7 +92,7 @@ namespace Catch {
8992 }
9093
9194 // Returns the current start pointer. May not be null-terminated.
92- constexpr char const * data () const noexcept {
95+ constexpr char const * data () const noexcept CATCH_ATTR_LIFETIMEBOUND {
9396 return m_start;
9497 }
9598
You can’t perform that action at this time.
0 commit comments