diff options
Diffstat (limited to 'src/strings/pair.hpp')
-rw-r--r-- | src/strings/pair.hpp | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/src/strings/pair.hpp b/src/strings/pair.hpp index a592a91..9c1cd9f 100644 --- a/src/strings/pair.hpp +++ b/src/strings/pair.hpp @@ -1,8 +1,7 @@ -#ifndef TMWA_STRINGS_PAIR_HPP -#define TMWA_STRINGS_PAIR_HPP +#pragma once // strings/pair.hpp - Internal contiguous range. // -// Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com> +// Copyright © 2013-2014 Ben Longbons <b.r.longbons@gmail.com> // // This file is part of The Mana World (Athena server) // @@ -19,12 +18,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -# include "../sanity.hpp" +#include "fwd.hpp" -# include <cstring> - -# include "fwd.hpp" +namespace tmwa +{ namespace strings { // TODO instead typedef ranges::Contiguous<const char> @@ -40,12 +38,6 @@ namespace strings XPair(const char *b, const char *e) : _begin(b), _end(e) {} - template<size_t n> - XPair(char (&arr)[n]) = delete; - template<size_t n> - XPair(const char (&arr)[n]) - : _begin(arr), _end(arr + strlen(arr)) - {} const char *begin() const { return _begin; } const char *end() const { return _end; } @@ -59,13 +51,15 @@ namespace strings ZPair(const char *b, const char *e) : XPair(b, e) {} - template<size_t n> - ZPair(char (&arr)[n]) = delete; - template<size_t n> - ZPair(const char (&arr)[n]) - : XPair(arr) + }; + struct LPair : ZPair + { + typedef LString TailSlice; + typedef XString FullSlice; + + LPair(const char *b, const char *e) + : ZPair(b, e) {} }; } // namespace strings - -#endif // TMWA_STRINGS_PAIR_HPP +} // namespace tmwa |