Skip to content

Commit 8f8abde

Browse files
authored
fix(util): qualify std:: names (#619)
1 parent 11fc88d commit 8f8abde

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

include/cpp2util.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ using __uchar = unsigned char; // normally use u8 instead
284284
//
285285
//-----------------------------------------------------------------------
286286
//
287-
template<size_t N>
287+
template<std::size_t N>
288288
struct String
289289
{
290290
constexpr String(const char (&str)[N])
@@ -902,7 +902,7 @@ inline constexpr auto is_narrowing_v =
902902
template <typename... Ts>
903903
inline constexpr auto program_violates_type_safety_guarantee = sizeof...(Ts) < 0;
904904

905-
// For literals we can check for safe 'narrowing' at a compile time (e.g., 1 as size_t)
905+
// For literals we can check for safe 'narrowing' at a compile time (e.g., 1 as std::size_t)
906906
template< typename C, auto x >
907907
inline constexpr bool is_castable_v =
908908
std::is_integral_v<C> &&
@@ -1021,7 +1021,7 @@ auto as( X x ) -> C {
10211021

10221022
// Common internal helper
10231023
//
1024-
template<size_t I, typename... Ts>
1024+
template<std::size_t I, typename... Ts>
10251025
constexpr auto operator_as( std::variant<Ts...> && x ) -> decltype(auto) {
10261026
if constexpr (I < std::variant_size_v<std::variant<Ts...>>) {
10271027
return std::get<I>( x );
@@ -1031,7 +1031,7 @@ constexpr auto operator_as( std::variant<Ts...> && x ) -> decltype(auto) {
10311031
}
10321032
}
10331033

1034-
template<size_t I, typename... Ts>
1034+
template<std::size_t I, typename... Ts>
10351035
constexpr auto operator_as( std::variant<Ts...> & x ) -> decltype(auto) {
10361036
if constexpr (I < std::variant_size_v<std::variant<Ts...>>) {
10371037
return std::get<I>( x );
@@ -1041,7 +1041,7 @@ constexpr auto operator_as( std::variant<Ts...> & x ) -> decltype(auto) {
10411041
}
10421042
}
10431043

1044-
template<size_t I, typename... Ts>
1044+
template<std::size_t I, typename... Ts>
10451045
constexpr auto operator_as( std::variant<Ts...> const& x ) -> decltype(auto) {
10461046
if constexpr (I < std::variant_size_v<std::variant<Ts...>>) {
10471047
return std::get<I>( x );
@@ -1491,7 +1491,7 @@ inline auto to_string(std::tuple<Ts...> const& t) -> std::string
14911491
//
14921492
struct args_t : std::vector<std::string_view>
14931493
{
1494-
args_t(int c, char** v) : vector{static_cast<size_t>(c)}, argc{c}, argv{v} {}
1494+
args_t(int c, char** v) : vector{static_cast<std::size_t>(c)}, argc{c}, argv{v} {}
14951495

14961496
int argc = 0;
14971497
char** argv = nullptr;
@@ -1500,7 +1500,7 @@ struct args_t : std::vector<std::string_view>
15001500
inline auto make_args(int argc, char** argv) -> args_t
15011501
{
15021502
auto ret = args_t{argc, argv};
1503-
auto args = std::span(argv, static_cast<size_t>(argc));
1503+
auto args = std::span(argv, static_cast<std::size_t>(argc));
15041504
std::copy( args.begin(), args.end(), ret.data());
15051505
return ret;
15061506
}
@@ -1596,7 +1596,7 @@ inline auto fopen( const char* filename, const char* mode ) {
15961596
if (!x) {
15971597
Throw( std::make_error_condition(std::errc::no_such_file_or_directory), "'fopen' attempt failed");
15981598
}
1599-
return c_raii( x, &fclose );
1599+
return c_raii( x, &std::fclose );
16001600
}
16011601

16021602
// Caveat: There's little else in the C stdlib that allocates a resource...

0 commit comments

Comments
 (0)