File: string.hpp

package info (click to toggle)
salmon 1.10.3%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 35,148 kB
  • sloc: cpp: 200,707; ansic: 171,082; sh: 859; python: 792; makefile: 238
file content (42 lines) | stat: -rwxr-xr-x 1,033 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef CORE_STRING_HPP
#define CORE_STRING_HPP

#include <core/memory_resource.hpp>
#include <core/algorithm.hpp>

#include <string>

namespace core {
inline namespace v2 {

template <class CharT, class Traits, class A, class Predicate>
void erase_if (::std::basic_string<CharT, Traits, A>& str, Predicate pred) {
  s.erase(::core::remove_if(str, pred), ::std::end(str));
}

template <class CharT, class Traits, class A, class U>
void erase (::std::basic_string<CharT, Traits, A>& str, U const& value) {
  s.erase(::core::remove(str, value), ::std::end(str));
}

}} /* namespace core::v2 */

namespace core {
inline namespace v2 {
namespace pmr {

template <class CharT, class Traits = ::std::char_traits<CharT>>
using basic_string = ::std::basic_string<
  CharT,
  Traits,
  polymorphic_allocator<CharT>
>;

using u32string = basic_string<char32_t>;
using u16string = basic_string<char16_t>;
using wstring = basic_string<wchar_t>;
using string = basic_string<char>;

}}} /* namespace core::v2::pmr */

#endif /* CORE_STRING_HPP */