Fix circular dependencies on string hashing
This commit is contained in:
parent
4e74e263c2
commit
4f65c38507
32
include/rexy/cx/basic_string_hash.hpp
Normal file
32
include/rexy/cx/basic_string_hash.hpp
Normal file
@ -0,0 +1,32 @@
|
||||
/**
|
||||
This file is a part of rexy's general purpose library
|
||||
Copyright (C) 2020 rexy712
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero 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 Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef REXY_CX_BASIC_STRING_HASH_HPP
|
||||
#define REXY_CX_BASIC_STRING_HASH_HPP
|
||||
|
||||
#include "string_hash.hpp"
|
||||
#include "../string.hpp"
|
||||
|
||||
namespace rexy::cx{
|
||||
|
||||
template<>
|
||||
struct hash<rexy::string> : public string_hash<rexy::string>{};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
32
include/rexy/cx/cx_string_hash.hpp
Normal file
32
include/rexy/cx/cx_string_hash.hpp
Normal file
@ -0,0 +1,32 @@
|
||||
/**
|
||||
This file is a part of rexy's general purpose library
|
||||
Copyright (C) 2020 rexy712
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero 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 Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef REXY_CX_CX_STRING_HASH_HPP
|
||||
#define REXY_CX_CX_STRING_HASH_HPP
|
||||
|
||||
#include "string_hash.hpp"
|
||||
#include "string.hpp"
|
||||
|
||||
namespace rexy::cx{
|
||||
|
||||
template<size_t N>
|
||||
struct hash<rexy::cx::string<N>> : public string_hash<rexy::cx::string<N>>{};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -39,4 +39,14 @@ namespace rexy::cx{
|
||||
|
||||
}
|
||||
|
||||
#ifdef REXY_STRING_BASE_HPP
|
||||
#include "static_string_hash.hpp"
|
||||
#endif
|
||||
#ifdef REXY_STRING_HPP
|
||||
#include "basic_string_hash.hpp"
|
||||
#endif
|
||||
#ifdef REXY_CX_STRING_HPP
|
||||
#include "cx_string_hash.hpp"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
32
include/rexy/cx/static_string_hash.hpp
Normal file
32
include/rexy/cx/static_string_hash.hpp
Normal file
@ -0,0 +1,32 @@
|
||||
/**
|
||||
This file is a part of rexy's general purpose library
|
||||
Copyright (C) 2020 rexy712
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero 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 Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef REXY_CX_STATIC_STRING_HASH_HPP
|
||||
#define REXY_CX_STATIC_STRING_HASH_HPP
|
||||
|
||||
#include "string_hash.hpp"
|
||||
#include "../string_base.hpp"
|
||||
|
||||
namespace rexy::cx{
|
||||
|
||||
template<>
|
||||
struct hash<rexy::static_string> : public string_hash<rexy::static_string>{};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -181,5 +181,8 @@ namespace rexy::cx{
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef REXY_CX_HASH_HPP
|
||||
#include "cx_string_hash.hpp"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -20,8 +20,6 @@
|
||||
#define REXY_CX_STRING_HASH_HPP
|
||||
|
||||
#include "hash.hpp"
|
||||
#include "../string.hpp"
|
||||
#include "string.hpp"
|
||||
|
||||
namespace rexy::cx{
|
||||
|
||||
@ -41,12 +39,6 @@ namespace rexy::cx{
|
||||
return hash;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct hash<rexy::static_string> : public string_hash<rexy::static_string>{};
|
||||
template<>
|
||||
struct hash<rexy::string> : public string_hash<rexy::string>{};
|
||||
template<size_t N>
|
||||
struct hash<rexy::cx::string<N>> : public string_hash<rexy::cx::string<N>>{};
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -32,5 +32,8 @@ namespace rexy{
|
||||
#ifdef REXY_BINARY_HPP
|
||||
#include "detail/binary_string_conv.hpp"
|
||||
#endif
|
||||
#ifdef REXY_CX_HASH_HPP
|
||||
#include "cx/basic_string_hash.hpp"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -244,7 +244,7 @@ namespace{
|
||||
}
|
||||
|
||||
#ifdef REXY_CX_HASH_HPP
|
||||
#include "cx/string_hash.hpp"
|
||||
#include "cx/static_string_hash.hpp"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user