##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::experimental::basic_string_view::data

From cppreference.com
< cpp‎ | experimental‎ | basic string view

constexpr const_pointer data() const; |  | (library fundamentals TS)

Returns a pointer to the underlying character array. The pointer is such that the range [data(); data() + size()) is valid and the values in it correspond to the values of the view. (n.b. Unlike `basic_string::data()` and string literals, `data()` may return a pointer to a buffer that is not null-terminated. Therefore it is typically a mistake to pass `data()` to a routine that takes just a `const CharT*` and expects a null-terminated string.)

### [edit] Parameters

(none)

### [edit] Return value

A pointer to the underlying character array.

### [edit] Exceptions

`noexcept` specification:
noexcept

### [edit] Complexity

Constant.

### [edit] See also

front | accesses the first character (public member function) [edit]
back | accesses the last character (public member function) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/experimental/basic_string_view/data&oldid=71255"
Category:

- unconditionally noexcept