util/StringBuffer: use std::size_t instead of size_t
This commit is contained in:
parent
2b301ffd2c
commit
2e8f42c6ad
@ -35,14 +35,14 @@
|
||||
/**
|
||||
* A statically allocated string buffer.
|
||||
*/
|
||||
template<typename T, size_t CAPACITY>
|
||||
template<typename T, std::size_t CAPACITY>
|
||||
class BasicStringBuffer {
|
||||
public:
|
||||
typedef T value_type;
|
||||
typedef T &reference;
|
||||
typedef T *pointer;
|
||||
typedef const T *const_pointer;
|
||||
typedef size_t size_type;
|
||||
typedef std::size_t size_type;
|
||||
|
||||
static constexpr value_type SENTINEL = '\0';
|
||||
|
||||
@ -104,7 +104,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template<size_t CAPACITY>
|
||||
template<std::size_t CAPACITY>
|
||||
class StringBuffer : public BasicStringBuffer<char, CAPACITY> {};
|
||||
|
||||
#endif
|
||||
|
@ -36,13 +36,13 @@
|
||||
|
||||
template<typename... Args>
|
||||
static inline void
|
||||
StringFormat(char *buffer, size_t size,
|
||||
StringFormat(char *buffer, std::size_t size,
|
||||
const char *fmt, Args&&... args) noexcept
|
||||
{
|
||||
snprintf(buffer, size, fmt, args...);
|
||||
}
|
||||
|
||||
template<size_t CAPACITY, typename... Args>
|
||||
template<std::size_t CAPACITY, typename... Args>
|
||||
static inline void
|
||||
StringFormat(StringBuffer<CAPACITY> &buffer,
|
||||
const char *fmt, Args&&... args) noexcept
|
||||
@ -50,7 +50,7 @@ StringFormat(StringBuffer<CAPACITY> &buffer,
|
||||
StringFormat(buffer.data(), buffer.capacity(), fmt, args...);
|
||||
}
|
||||
|
||||
template<size_t CAPACITY, typename... Args>
|
||||
template<std::size_t CAPACITY, typename... Args>
|
||||
static inline StringBuffer<CAPACITY>
|
||||
StringFormat(const char *fmt, Args&&... args) noexcept
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user