General Utility Library for C++14  2.7
Public Member Functions | List of all members
gul14::ConvertingStringView Class Reference

Detailed Description

A string view that can automatically convert numbers into strings.

This class is primarily intended for use as a parameter in gul14::cat(). For string-like arguments, it acts similar to gul14::string_view. Number-like arguments (double, int, ...) are converted into strings in a default format using std::to_string. Arguments of type char are converted into a string of length 1.

#include <cat.h>

Public Member Functions

const char * data () const noexcept
 Return a pointer to the internal character buffer. More...
 
std::size_t length () const noexcept
 Return the length of the string.
 
std::size_t size () const noexcept
 Return the length of the string.
 
 operator std::string () const
 Construct a std::string from this ConvertingStringView.
 

Member Function Documentation

◆ data()

const char* gul14::ConvertingStringView::data ( ) const
inlinenoexcept

Return a pointer to the internal character buffer.

The contained string is usually not null-terminated.

Referenced by gul14::cat().


The documentation for this class was generated from the following file: