/** This file is a part of rexy's general purpose library Copyright (C) 2020-2022 rexy712 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef REXY_STRING_VIEW_TPP #define REXY_STRING_VIEW_TPP #include "compat/to_address.hpp" #include "utility.hpp" #include "string_base.hpp" namespace rexy{ template constexpr basic_string_view::basic_string_view(void)noexcept: basic_string_view(nullptr, 0){} template constexpr basic_string_view::basic_string_view(const_pointer str, size_type len)noexcept: m_data(str), m_length(len){} template constexpr basic_string_view::basic_string_view(const basic_string_view& s)noexcept: m_data(s.m_data), m_length(s.m_length){} template constexpr basic_string_view::basic_string_view(const string_base& s)noexcept: m_data(s.c_str()), m_length(s.length()){} template constexpr basic_string_view::basic_string_view(basic_string_view&& s)noexcept: m_data(s.m_data), m_length(s.m_length){} template template constexpr basic_string_view::basic_string_view(InIter start, InIter fin)noexcept: basic_string_view(compat::to_address(start), fin - start){} template constexpr basic_string_view& basic_string_view::operator=(const basic_string_view& s)noexcept{ m_data = s.m_data; m_length = s.m_length; return *this; } template constexpr basic_string_view::basic_string_view(const_pointer c)noexcept: basic_string_view(c, strlen(c)){} template constexpr basic_string_view& basic_string_view::operator=(const_pointer c)noexcept{ m_data = c; m_length = strlen(c); return *this; } template constexpr basic_string_view& basic_string_view::operator=(basic_string_view&& s)noexcept{ m_data = s.m_data; m_length = s.m_length; return *this; } } #endif