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
fd2292f1
Commit
fd2292f1
authored
Jun 17, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup checked iterators
parent
4912cff6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
include/fmt/format.h
include/fmt/format.h
+5
-9
No files found.
include/fmt/format.h
View file @
fd2292f1
...
@@ -307,17 +307,13 @@ class format_error : public std::runtime_error {
...
@@ -307,17 +307,13 @@ class format_error : public std::runtime_error {
namespace
internal
{
namespace
internal
{
#if FMT_SECURE_SCL
#if FMT_SECURE_SCL
template
<
typename
T
>
struct
checked
{
// Make a checked iterator to avoid MSVC warnings.
typedef
stdext
::
checked_array_iterator
<
T
*>
type
;
template
<
typename
T
>
using
checked_ptr
=
stdext
::
checked_array_iterator
<
T
*>
;
};
template
<
typename
T
>
checked_ptr
<
T
>
make_checked
(
T
*
p
,
std
::
size_t
size
)
{
// Make a checked iterator to avoid warnings on MSVC.
template
<
typename
T
>
inline
stdext
::
checked_array_iterator
<
T
*>
make_checked
(
T
*
p
,
std
::
size_t
size
)
{
return
{
p
,
size
};
return
{
p
,
size
};
}
}
#else
#else
template
<
typename
T
>
struct
checked
{
typedef
T
*
type
;
}
;
template
<
typename
T
>
using
checked_ptr
=
T
*
;
template
<
typename
T
>
inline
T
*
make_checked
(
T
*
p
,
std
::
size_t
)
{
return
p
;
}
template
<
typename
T
>
inline
T
*
make_checked
(
T
*
p
,
std
::
size_t
)
{
return
p
;
}
#endif
#endif
...
@@ -487,7 +483,7 @@ inline typename Container::value_type* get_data(Container& c) {
...
@@ -487,7 +483,7 @@ inline typename Container::value_type* get_data(Container& c) {
}
}
template
<
typename
Container
,
FMT_ENABLE_IF
(
is_contiguous
<
Container
>
::
value
)
>
template
<
typename
Container
,
FMT_ENABLE_IF
(
is_contiguous
<
Container
>
::
value
)
>
inline
typename
checked
<
typename
Container
::
value_type
>::
type
reserve
(
inline
checked_ptr
<
typename
Container
::
value_type
>
reserve
(
std
::
back_insert_iterator
<
Container
>&
it
,
std
::
size_t
n
)
{
std
::
back_insert_iterator
<
Container
>&
it
,
std
::
size_t
n
)
{
Container
&
c
=
internal
::
get_container
(
it
);
Container
&
c
=
internal
::
get_container
(
it
);
std
::
size_t
size
=
c
.
size
();
std
::
size_t
size
=
c
.
size
();
...
...
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