basic_unbounded_string#

Fully qualified name: carb::cpp::basic_unbounded_string

Defined in carb/cpp/UnboundedString.h

template<typename CharT>
class basic_unbounded_string#

A class that represents an unbounded string.

This class is used to represent an unbounded string (i.e. a character pointer to a null-terminated string). The difference between this class and const char* is that this class will not be constructed from pointer decays (e.g. char[N]).

Template Parameters:

TChar – The character type.

Public Types

using value_type = CharT#

CharT

using pointer = CharT*#

CharT*

using const_pointer = const CharT*#

const CharT*

using size_type = std::size_t#

std::size_t

Public Functions

inline constexpr basic_unbounded_string() noexcept#

Default constructor.

template<typename T, std::enable_if_t<is_unbounded_character_sequence_v<remove_cvref_t<T>, value_type>, bool> = true>
inline constexpr basic_unbounded_string(
T &&ptr,
) noexcept#

Constructor from a character sequence.

Note

Due to a bug, in GCC this constructor sometimes is triggered with char[N]

Template Parameters:

T – The character sequence type.

Parameters:

ptr – The character sequence.

inline constexpr operator const_pointer() const noexcept#

Conversion operator to a character pointer.

Returns:

The character pointer.

inline constexpr const_pointer c_str() const noexcept#

Returns a pointer to the first character of a view.

Returns:

A pointer to the first character of the view.

inline constexpr const_pointer data() const noexcept#

Returns a pointer to the first character of a view.

Returns:

A pointer to the first character of the view.