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
bbf0bada
Commit
bbf0bada
authored
Jul 26, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify compile
parent
3730b4f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
19 deletions
+5
-19
include/fmt/compile.h
include/fmt/compile.h
+4
-18
test/compile-test.cc
test/compile-test.cc
+1
-1
No files found.
include/fmt/compile.h
View file @
bbf0bada
...
...
@@ -676,25 +676,11 @@ auto do_compile(const Format& format)
return
preparator
<
Format
,
Args
...
>::
prepare
(
format
);
}
#endif
}
// namespace internal
template
<
typename
...
Args
>
struct
prepared_format
{
typedef
typename
internal
::
basic_prepared_format
<
std
::
string
,
internal
::
parts_container
<
char
>
,
Args
...
>::
type
type
;
};
template
<
typename
...
Args
>
struct
wprepared_format
{
typedef
typename
internal
::
basic_prepared_format
<
std
::
wstring
,
internal
::
parts_container
<
wchar_t
>
,
Args
...
>::
type
type
;
};
template
<
typename
...
Args
>
using
prepared_format_t
=
typename
internal
::
basic_prepared_format
<
std
::
string
,
internal
::
parts_container
<
char
>
,
Args
...
>::
type
;
template
<
typename
...
Args
>
using
wprepared_format_t
=
typename
internal
::
basic_prepared_format
<
std
::
wstring
,
internal
::
parts_container
<
wchar_t
>
,
Args
...
>::
type
;
template
<
typename
...
Args
>
using
prepared_format_t
=
typename
basic_prepared_format
<
std
::
string
,
parts_container
<
char
>
,
Args
...
>::
type
;
}
// namespace internal
#if FMT_USE_CONSTEXPR
...
...
test/compile-test.cc
View file @
bbf0bada
...
...
@@ -476,7 +476,7 @@ TEST(PrepareTest, CopyPreparedFormat_InternalStringViewsAreNotInvalidated) {
}
TEST
(
PrepareTest
,
ReusedPreparedFormatType
)
{
typedef
fmt
::
prepared_format
<
std
::
string
,
int
>::
type
prepared_format
;
using
prepared_format
=
fmt
::
internal
::
prepared_format_t
<
std
::
string
,
int
>
;
prepared_format
prepared
=
fmt
::
compile
<
prepared_format
>
(
"The {} is {}."
);
EXPECT_EQ
(
"The answer is 42."
,
prepared
.
format
(
"answer"
,
42
));
...
...
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