tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
strcpy.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2020 Tobias Hienzsch
3
4#ifndef TETL_CSTRING_STRCPY_HPP
5#define TETL_CSTRING_STRCPY_HPP
6
7#include <etl/_contracts/check.hpp>
8#include <etl/_cstddef/size_t.hpp>
9#include <etl/_strings/cstr.hpp>
10
11namespace etl {
12
13/// Copies the character string pointed to by src, including the null
14/// terminator, to the character array whose first element is pointed to by
15/// dest.
16///
17/// The behavior is undefined if the dest array is not large enough.
18/// The behavior is undefined if the strings overlap.
19///
20/// \returns dest
21/// \ingroup cstring
22constexpr auto strcpy(char* dest, char const* src) -> char*
23{
24 TETL_PRECONDITION(dest != nullptr);
25 TETL_PRECONDITION(src != nullptr);
26 return etl::detail::strcpy(dest, src);
27}
28
29} // namespace etl
30
31#endif // TETL_CSTRING_STRCPY_HPP
constexpr auto strcpy(char *dest, char const *src) -> char *
Copies the character string pointed to by src, including the null terminator, to the character array ...
Definition strcpy.hpp:22
Definition adjacent_find.hpp:9