Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
5d9100fa
Commit
5d9100fa
authored
Jun 08, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move char8_t to fmt/core.h
parent
4faadff0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
include/fmt/core.h
include/fmt/core.h
+7
-2
include/fmt/format.h
include/fmt/format.h
+0
-8
No files found.
include/fmt/core.h
View file @
5d9100fa
...
...
@@ -322,10 +322,16 @@ template <typename Char> class basic_string_view {
using
string_view
=
basic_string_view
<
char
>
;
using
wstring_view
=
basic_string_view
<
wchar_t
>
;
#ifndef __cpp_char8_t
// A UTF-8 code unit type.
enum
char8_t
:
unsigned
char
{};
#endif
/** Specifies if ``T`` is a character type. Can be specialized by users. */
template
<
typename
T
>
struct
is_char
:
std
::
false_type
{};
template
<
>
struct
is_char
<
char
>
:
std
::
true_type
{};
template
<
>
struct
is_char
<
wchar_t
>
:
std
::
true_type
{};
template
<
>
struct
is_char
<
char8_t
>
:
std
::
true_type
{};
template
<
>
struct
is_char
<
char16_t
>
:
std
::
true_type
{};
template
<
>
struct
is_char
<
char32_t
>
:
std
::
true_type
{};
...
...
@@ -719,7 +725,7 @@ template <typename Context> class value {
// Get the formatter type through the context to allow different contexts
// have different extension points, e.g. `formatter<T>` for `format` and
// `printf_formatter<T>` for `printf`.
custom
.
format
=
&
format_custom_arg
<
custom
.
format
=
format_custom_arg
<
T
,
conditional_t
<
has_formatter
<
T
,
Context
>::
value
,
typename
Context
::
template
formatter_type
<
T
>,
internal
::
fallback_formatter
<
T
,
char_type
>>>
;
...
...
@@ -1030,7 +1036,6 @@ template <typename Context> class arg_map {
class
locale_ref
{
private:
const
void
*
locale_
;
// A type-erased pointer to std::locale.
friend
class
locale
;
public:
locale_ref
()
:
locale_
(
nullptr
)
{}
...
...
include/fmt/format.h
View file @
5d9100fa
...
...
@@ -394,14 +394,6 @@ void buffer<T>::append(const U* begin, const U* end) {
}
}
// namespace internal
// C++20 feature test, since r346892 Clang considers char8_t a fundamental
// type in this mode. If this is the case __cpp_char8_t will be defined.
#if !defined(__cpp_char8_t)
// A UTF-8 code unit type.
enum
char8_t
:
unsigned
char
{};
#endif
template
<
>
struct
is_char
<
char8_t
>
:
std
::
true_type
{};
// A UTF-8 string view.
class
u8string_view
:
public
basic_string_view
<
char8_t
>
{
public:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment