Refactor TSTL headers

This commit is contained in:
Baptiste Wicht 2018-04-05 11:05:05 +02:00
parent 9cfa4e2d01
commit 1c64a15342
3 changed files with 27 additions and 8 deletions

25
tstl/include/cstring.hpp Normal file
View File

@ -0,0 +1,25 @@
//=======================================================================
// Copyright Baptiste Wicht 2013-2018.
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
// http://www.opensource.org/licenses/MIT)
//=======================================================================
#ifndef CSTRING_H
#define CSTRING_H
#include <types.hpp>
namespace std {
inline uint64_t str_len(const char* a){
uint64_t length = 0;
while(*a++){
++length;
}
return length;
}
} //end of namespace std
#endif

View File

@ -8,6 +8,7 @@
#ifndef STRING_H
#define STRING_H
#include <cstring.hpp>
#include <string_view.hpp>
#include <types.hpp>
#include <algorithms.hpp>
@ -17,14 +18,6 @@
namespace std {
inline uint64_t str_len(const char* a){
uint64_t length = 0;
while(*a++){
++length;
}
return length;
}
template<typename CharT>
struct base_long {
size_t capacity;

View File

@ -8,6 +8,7 @@
#ifndef STRING_VIEW_H
#define STRING_VIEW_H
#include <cstring.hpp>
#include <types.hpp>
#include <algorithms.hpp>
#include <iterator.hpp>