mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-28 18:32:46 +00:00
typedef -> using
This commit is contained in:
parent
ded0a3bb3d
commit
78dec87a46
@ -464,12 +464,12 @@ template <typename T> class counting_iterator {
|
|||||||
mutable T blackhole_;
|
mutable T blackhole_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef std::output_iterator_tag iterator_category;
|
using iterator_category = std::output_iterator_tag;
|
||||||
typedef T value_type;
|
using value_type = T;
|
||||||
typedef std::ptrdiff_t difference_type;
|
using difference_type = std::ptrdiff_t;
|
||||||
typedef T* pointer;
|
using pointer = T*;
|
||||||
typedef T& reference;
|
using reference = T&;
|
||||||
typedef counting_iterator _Unchecked_type; // Mark iterator as checked.
|
using _Unchecked_type = counting_iterator; // Mark iterator as checked.
|
||||||
|
|
||||||
counting_iterator() : count_(0) {}
|
counting_iterator() : count_(0) {}
|
||||||
|
|
||||||
@ -499,12 +499,12 @@ template <typename OutputIt> class truncating_iterator_base {
|
|||||||
: out_(out), limit_(limit), count_(0) {}
|
: out_(out), limit_(limit), count_(0) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef std::output_iterator_tag iterator_category;
|
using iterator_category = std::output_iterator_tag;
|
||||||
typedef void difference_type;
|
using difference_type = void;
|
||||||
typedef void pointer;
|
using pointer = void;
|
||||||
typedef void reference;
|
using reference = void;
|
||||||
typedef truncating_iterator_base
|
using _Unchecked_type =
|
||||||
_Unchecked_type; // Mark iterator as checked.
|
truncating_iterator_base; // Mark iterator as checked.
|
||||||
|
|
||||||
OutputIt base() const { return out_; }
|
OutputIt base() const { return out_; }
|
||||||
std::size_t count() const { return count_; }
|
std::size_t count() const { return count_; }
|
||||||
@ -520,12 +520,12 @@ class truncating_iterator;
|
|||||||
template <typename OutputIt>
|
template <typename OutputIt>
|
||||||
class truncating_iterator<OutputIt, std::false_type>
|
class truncating_iterator<OutputIt, std::false_type>
|
||||||
: public truncating_iterator_base<OutputIt> {
|
: public truncating_iterator_base<OutputIt> {
|
||||||
typedef std::iterator_traits<OutputIt> traits;
|
using traits = std::iterator_traits<OutputIt>;
|
||||||
|
|
||||||
mutable typename traits::value_type blackhole_;
|
mutable typename traits::value_type blackhole_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef typename traits::value_type value_type;
|
using value_type = typename traits::value_type;
|
||||||
|
|
||||||
truncating_iterator(OutputIt out, std::size_t limit)
|
truncating_iterator(OutputIt out, std::size_t limit)
|
||||||
: truncating_iterator_base<OutputIt>(out, limit) {}
|
: truncating_iterator_base<OutputIt>(out, limit) {}
|
||||||
@ -550,7 +550,7 @@ template <typename OutputIt>
|
|||||||
class truncating_iterator<OutputIt, std::true_type>
|
class truncating_iterator<OutputIt, std::true_type>
|
||||||
: public truncating_iterator_base<OutputIt> {
|
: public truncating_iterator_base<OutputIt> {
|
||||||
public:
|
public:
|
||||||
typedef typename OutputIt::container_type::value_type value_type;
|
using value_type = typename OutputIt::container_type::value_type;
|
||||||
|
|
||||||
truncating_iterator(OutputIt out, std::size_t limit)
|
truncating_iterator(OutputIt out, std::size_t limit)
|
||||||
: truncating_iterator_base<OutputIt>(out, limit) {}
|
: truncating_iterator_base<OutputIt>(out, limit) {}
|
||||||
@ -566,7 +566,7 @@ class truncating_iterator<OutputIt, std::true_type>
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Returns true if value is negative, false otherwise.
|
// Returns true if value is negative, false otherwise.
|
||||||
// Same as (value < 0) but doesn't produce warnings if T is an unsigned type.
|
// Same as `value < 0` but doesn't produce warnings if T is an unsigned type.
|
||||||
template <typename T, FMT_ENABLE_IF(std::numeric_limits<T>::is_signed)>
|
template <typename T, FMT_ENABLE_IF(std::numeric_limits<T>::is_signed)>
|
||||||
FMT_CONSTEXPR bool is_negative(T value) {
|
FMT_CONSTEXPR bool is_negative(T value) {
|
||||||
return value < 0;
|
return value < 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user