diff --git a/UnitTests/compat.hpp b/UnitTests/compat.hpp index 2585dcb90..71bd35b72 100644 --- a/UnitTests/compat.hpp +++ b/UnitTests/compat.hpp @@ -28,14 +28,14 @@ namespace Assert } template - inline void AreEqual(const T& a, const T& b) + void AreEqual(const T& a, const T& b) { if (!(a == b)) throw std::runtime_error("not equal"); } template - inline void AreEqual(const T (&a)[N], const T (&b)[N]) + void AreEqual(const T (&a)[N], const T (&b)[N]) { for (size_t i = 0; i < N; ++i) if (!(a[i] == b[i])) @@ -55,7 +55,7 @@ namespace Assert } template - inline void AreNotEqual(const T& a, const T& b) + void AreNotEqual(const T& a, const T& b) { if (a == b) throw std::runtime_error("equal"); @@ -74,7 +74,7 @@ namespace Assert } template - inline void ExpectException(F functor) + void ExpectException(F functor) { try { functor(); } catch (const E&) { return; } diff --git a/include/stdex/hash.hpp b/include/stdex/hash.hpp index ce48d1403..441bd3ce1 100644 --- a/include/stdex/hash.hpp +++ b/include/stdex/hash.hpp @@ -45,17 +45,17 @@ namespace stdex /// /// Returns size of the hash value in bytes /// - static inline size_t size() { return sizeof(T); } + static size_t size() { return sizeof(T); } /// /// Returns hash value /// - inline const T& data() { return m_value; }; + const T& data() { return m_value; }; /// /// Returns hash value /// - inline operator const T&() const { return m_value; }; + operator const T&() const { return m_value; }; protected: T m_value; @@ -259,7 +259,7 @@ namespace stdex uint8_t data8[16]; uint32_t data32[4]; - inline bool operator !=(_In_ const stdex::md2_t& other) const + bool operator !=(_In_ const stdex::md2_t& other) const { return (data32[0] ^ other.data32[0]) | @@ -268,7 +268,7 @@ namespace stdex (data32[3] ^ other.data32[3]); } - inline bool operator ==(_In_ const stdex::md2_t& other) const + bool operator ==(_In_ const stdex::md2_t& other) const { return !operator !=(other); } @@ -459,7 +459,7 @@ namespace stdex uint8_t data8[20]; uint32_t data32[5]; - inline bool operator !=(_In_ const stdex::sha_t& other) const + bool operator !=(_In_ const stdex::sha_t& other) const { return (data32[0] ^ other.data32[0]) | @@ -469,7 +469,7 @@ namespace stdex (data32[4] ^ other.data32[4]); } - inline bool operator ==(_In_ const stdex::sha_t& other) const + bool operator ==(_In_ const stdex::sha_t& other) const { return !operator !=(other); } @@ -608,7 +608,7 @@ namespace stdex uint8_t data8[32]; uint32_t data32[8]; - inline bool operator !=(_In_ const stdex::sha256_t& other) const + bool operator !=(_In_ const stdex::sha256_t& other) const { return (data32[0] ^ other.data32[0]) | @@ -621,7 +621,7 @@ namespace stdex (data32[7] ^ other.data32[7]); } - inline bool operator ==(_In_ const stdex::sha256_t& other) const + bool operator ==(_In_ const stdex::sha256_t& other) const { return !operator !=(other); } diff --git a/include/stdex/html.hpp b/include/stdex/html.hpp index aa2e65440..619e988db 100644 --- a/include/stdex/html.hpp +++ b/include/stdex/html.hpp @@ -38,7 +38,7 @@ namespace stdex /// \param[in] num_chars Code unit limit in string `src` /// template, class _Alloc = std::allocator> - inline void escape( + void escape( _Inout_ std::basic_string& dst, _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars) { @@ -65,7 +65,7 @@ namespace stdex /// \param[in] num_chars Code unit limit in string `src` /// template, class _Alloc = std::allocator> - inline void escape( + void escape( _Inout_ std::basic_string& dst, _In_reads_or_z_opt_(num_chars) const wchar_t* src, _In_ size_t num_chars) { @@ -91,7 +91,7 @@ namespace stdex /// \param[in] src Source string /// template, class _Alloc = std::allocator<_Elem>> - inline void escape( + void escape( _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& dst, _In_ const _Elem (&src)[_Size]) { @@ -105,7 +105,7 @@ namespace stdex /// \param[in] src Source string /// template, class _Alloc_dst = std::allocator<_Elem>, class _Traits_src = std::char_traits<_Elem>, class _Alloc_src = std::allocator<_Elem>> - inline void escape( + void escape( _Inout_ std::basic_string<_Elem, _Traits_dst, _Alloc_dst>& dst, _In_ const std::basic_string<_Elem, _Traits_src, _Alloc_src>& src) { @@ -119,7 +119,7 @@ namespace stdex /// \param[in] chr Source character /// template, class _Alloc = std::allocator> - inline void escape_min(_Inout_ std::basic_string& dst, _In_ char chr) + void escape_min(_Inout_ std::basic_string& dst, _In_ char chr) { switch (chr) { case '&': dst += "&"; break; @@ -137,7 +137,7 @@ namespace stdex /// \param[in] chr Source character /// template, class _Alloc = std::allocator> - inline void escape_min(_Inout_ std::basic_string& dst, _In_ wchar_t chr) + void escape_min(_Inout_ std::basic_string& dst, _In_ wchar_t chr) { switch (chr) { case L'&': dst += L"&"; break; @@ -156,7 +156,7 @@ namespace stdex /// \param[in] num_chars Code unit limit in string `src` /// template, class _Alloc = std::allocator> - inline void escape_min( + void escape_min( _Inout_ std::basic_string& dst, _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars) { @@ -180,7 +180,7 @@ namespace stdex /// \param[in] num_chars Code unit limit in string `src` /// template, class _Alloc = std::allocator> - inline void escape_min( + void escape_min( _Inout_ std::basic_string& dst, _In_reads_or_z_opt_(num_chars) const wchar_t* src, _In_ size_t num_chars) { @@ -203,7 +203,7 @@ namespace stdex /// \param[in] src Source string /// template, class _Alloc = std::allocator<_Elem>> - inline void escape_min( + void escape_min( _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& dst, _In_ const _Elem (&src)[_Size]) { @@ -217,7 +217,7 @@ namespace stdex /// \param[in] src Source string /// template, class _Alloc_dst = std::allocator<_Elem>, class _Traits_src = std::char_traits<_Elem>, class _Alloc_src = std::allocator<_Elem>> - inline void escape_min( + void escape_min( _Inout_ std::basic_string<_Elem, _Traits_dst, _Alloc_dst>& dst, _In_ const std::basic_string<_Elem, _Traits_src, _Alloc_src>& src) { @@ -232,7 +232,7 @@ namespace stdex /// \param[in] num_chars Code unit limit in string `src` /// template, class _Alloc = std::allocator> - inline void url_unescape( + void url_unescape( _Inout_ std::basic_string& dst, _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars) { @@ -273,7 +273,7 @@ namespace stdex /// \param[in] src Source string /// template, class _Alloc = std::allocator> - inline void url_unescape( + void url_unescape( _Inout_ std::basic_string& dst, _In_ const char (&src)[_Size]) { @@ -287,7 +287,7 @@ namespace stdex /// \param[in] src Source string /// template, class _Alloc_dst = std::allocator, class _Traits_src = std::char_traits, class _Alloc_src = std::allocator> - inline void url_unescape( + void url_unescape( _Inout_ std::basic_string& dst, _In_ const std::basic_string& src) { @@ -302,7 +302,7 @@ namespace stdex /// \param[in] num_chars Code unit limit in string `src` /// template, class _Alloc = std::allocator> - inline void url_escape( + void url_escape( _Inout_ std::basic_string& dst, _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars) { @@ -352,7 +352,7 @@ namespace stdex /// \param[in] src Source string /// template, class _Alloc = std::allocator> - inline void url_escape( + void url_escape( _Inout_ std::basic_string& dst, _In_ const char (&src)[_Size]) { @@ -366,7 +366,7 @@ namespace stdex /// \param[in] src Source string /// template, class _Alloc_dst = std::allocator, class _Traits_src = std::char_traits, class _Alloc_src = std::allocator> - inline void url_escape( + void url_escape( _Inout_ std::basic_string& dst, _In_ const std::basic_string& src) { @@ -381,7 +381,7 @@ namespace stdex /// \param[in] num_chars Code unit limit in string `src` /// template, class _Alloc = std::allocator<_Elem>> - inline void css_unescape( + void css_unescape( _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& dst, _In_reads_or_z_opt_(num_chars) const _Elem* src, _In_ size_t num_chars) { @@ -450,7 +450,7 @@ namespace stdex /// \param[in] src Source string /// template, class _Alloc = std::allocator<_Elem>> - inline void css_unescape( + void css_unescape( _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& dst, _In_ const _Elem (&src)[_Size]) { @@ -464,7 +464,7 @@ namespace stdex /// \param[in] src Source string /// template, class _Alloc_dst = std::allocator<_Elem>, class _Traits_src = std::char_traits<_Elem>, class _Alloc_src = std::allocator<_Elem>> - inline void css_unescape( + void css_unescape( _Inout_ std::basic_string<_Elem, _Traits_dst, _Alloc_dst>& dst, _In_ const std::basic_string<_Elem, _Traits_src, _Alloc_src>& src) { @@ -479,7 +479,7 @@ namespace stdex /// \param[in] num_chars Code unit limit in string `src` /// template, class _Alloc = std::allocator> - inline void css_escape( + void css_escape( _Inout_ std::basic_string& dst, _In_reads_or_z_opt_(num_chars) const char* src, _In_ size_t num_chars) { @@ -505,7 +505,7 @@ namespace stdex /// \param[in] num_chars Code unit limit in string `src` /// template, class _Alloc = std::allocator> - inline void css_escape( + void css_escape( _Inout_ std::basic_string& dst, _In_reads_or_z_opt_(num_chars) const wchar_t* src, _In_ size_t num_chars) { @@ -530,7 +530,7 @@ namespace stdex /// \param[in] src Source string /// template, class _Alloc = std::allocator<_Elem>> - inline void css_escape( + void css_escape( _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& dst, _In_ const _Elem (&src)[_Size]) { @@ -544,7 +544,7 @@ namespace stdex /// \param[in] src Source string /// template, class _Alloc_dst = std::allocator<_Elem>, class _Traits_src = std::char_traits<_Elem>, class _Alloc_src = std::allocator<_Elem>> - inline void css_escape( + void css_escape( _Inout_ std::basic_string<_Elem, _Traits_dst, _Alloc_dst>& dst, _In_ const std::basic_string<_Elem, _Traits_src, _Alloc_src>& src) { @@ -686,7 +686,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline element_span_t span(_In_ element_t code) + static element_span_t span(_In_ element_t code) { static element_span_t lookup[] = { element_span_t::needs_end, // a @@ -805,7 +805,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_fontstyle(_In_ element_t code) + static bool is_fontstyle(_In_ element_t code) { switch (code) { case element_t::tt: @@ -827,7 +827,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_phrase(_In_ element_t code) + static bool is_phrase(_In_ element_t code) { switch (code) { case element_t::em: @@ -851,7 +851,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_special(_In_ element_t code) + static bool is_special(_In_ element_t code) { switch (code) { case element_t::a: @@ -884,7 +884,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_formctrl(_In_ element_t code) + static bool is_formctrl(_In_ element_t code) { switch (code) { case element_t::input: @@ -902,7 +902,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_inline(_In_ element_t code) + static bool is_inline(_In_ element_t code) { return code == element_t::PCDATA || @@ -917,7 +917,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_heading(_In_ element_t code) + static bool is_heading(_In_ element_t code) { switch (code) { case element_t::h1: @@ -936,7 +936,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_list(_In_ element_t code) + static bool is_list(_In_ element_t code) { switch (code) { case element_t::ul: @@ -953,7 +953,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_preformatted(_In_ element_t code) + static bool is_preformatted(_In_ element_t code) { switch (code) { case element_t::pre: @@ -968,7 +968,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_block(_In_ element_t code) + static bool is_block(_In_ element_t code) { if (is_heading(code) || is_list(code) || @@ -999,7 +999,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_flow(_In_ element_t code) + static bool is_flow(_In_ element_t code) { return is_block(code) || is_inline(code); } @@ -1009,7 +1009,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_head_content(_In_ element_t code) + static bool is_head_content(_In_ element_t code) { switch (code) { case element_t::title: @@ -1026,7 +1026,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_head_misc(_In_ element_t code) + static bool is_head_misc(_In_ element_t code) { switch (code) { case element_t::script: @@ -1044,7 +1044,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_pre_exclusion(_In_ element_t code) + static bool is_pre_exclusion(_In_ element_t code) { switch (code) { case element_t::img: @@ -1069,7 +1069,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_html_content(_In_ element_t code) + static bool is_html_content(_In_ element_t code) { switch (code) { case element_t::head: @@ -1085,7 +1085,7 @@ namespace stdex /// /// \param[in] code Element code /// - static inline bool is_group(_In_ element_t code) + static bool is_group(_In_ element_t code) { if (is_block(code) || is_html_content(code) || @@ -1115,7 +1115,7 @@ namespace stdex /// /// \returns `true` if `child` may nest in `parent`; `false` otherwise /// - static inline bool may_contain(_In_ element_t parent, _In_ element_t child) + static bool may_contain(_In_ element_t parent, _In_ element_t child) { if (child == element_t::unknown || child == element_t::comment) return true; @@ -1215,7 +1215,7 @@ namespace stdex /// \param[in] num_chars Code unit limit in `attr_name` /// template - static inline bool is_uri(_In_ element_t code, _In_reads_or_z_opt_(num_chars) const T* attr_name, _In_ size_t num_chars) + static bool is_uri(_In_ element_t code, _In_reads_or_z_opt_(num_chars) const T* attr_name, _In_ size_t num_chars) { _Assume_(attr_name || !num_chars); switch (code) { @@ -1270,7 +1270,7 @@ namespace stdex /// \param[in] num_chars Code unit limit in `attr_name` /// template - static inline bool is_localizable(element_t code, const T* attr_name, size_t num_chars) + static bool is_localizable(element_t code, const T* attr_name, size_t num_chars) { _Assume_(attr_name || !num_chars); if (!stdex::strnicmp(attr_name, num_chars, "title", SIZE_MAX)) @@ -1318,7 +1318,7 @@ namespace stdex { public: template - inline element(_Inout_ stdex::parser::basic_html_tag&& tag, _In_z_ const T* src, _In_opt_ sequence* parent = nullptr) : + element(_Inout_ stdex::parser::basic_html_tag&& tag, _In_z_ const T* src, _In_opt_ sequence* parent = nullptr) : sequence(tag.type, tag.interval.start, tag.interval.end, parent), code(element_code(src + tag.name.start, tag.name.size())), name(std::move(tag.name)), @@ -1497,7 +1497,7 @@ namespace stdex { public: template - inline element_start(_Inout_ stdex::parser::basic_html_tag&& tag, _In_z_ const T* src, _In_opt_ sequence* parent = nullptr, _In_opt_ sequence* _end = nullptr) : + element_start(_Inout_ stdex::parser::basic_html_tag&& tag, _In_z_ const T* src, _In_opt_ sequence* parent = nullptr, _In_opt_ sequence* _end = nullptr) : element(std::move(tag), src, parent), end(_end) {} @@ -1513,7 +1513,7 @@ namespace stdex { public: template - inline element_end(_Inout_ stdex::parser::basic_html_tag&& tag, _In_z_ const T* src, _In_opt_ sequence* parent = nullptr, _In_opt_ element_start* _start = nullptr) : + element_end(_Inout_ stdex::parser::basic_html_tag&& tag, _In_z_ const T* src, _In_opt_ sequence* parent = nullptr, _In_opt_ element_start* _start = nullptr) : sequence(tag.type, tag.interval.start, tag.interval.end, parent), code(element::element_code(src + tag.name.start, tag.name.size())), name(std::move(tag.name)), @@ -1533,7 +1533,7 @@ namespace stdex { public: template - inline declaration(_Inout_ stdex::parser::basic_html_tag&& tag, _In_opt_ sequence* parent = nullptr) : + declaration(_Inout_ stdex::parser::basic_html_tag&& tag, _In_opt_ sequence* parent = nullptr) : sequence(tag.type, tag.interval.start, tag.interval.end, parent), name(std::move(tag.name)), attributes(std::move(tag.attributes)) @@ -1551,7 +1551,7 @@ namespace stdex { public: template - inline comment(_Inout_ stdex::parser::basic_html_tag&& tag, _In_opt_ sequence* parent = nullptr) : + comment(_Inout_ stdex::parser::basic_html_tag&& tag, _In_opt_ sequence* parent = nullptr) : sequence(tag.type, tag.interval.start, tag.interval.end, parent), content(std::move(tag.name)) {} @@ -1567,7 +1567,7 @@ namespace stdex { public: template - inline instruction(_Inout_ stdex::parser::basic_html_tag&& tag, _In_opt_ sequence* parent = nullptr) : + instruction(_Inout_ stdex::parser::basic_html_tag&& tag, _In_opt_ sequence* parent = nullptr) : sequence(tag.type, tag.interval.start, tag.interval.end, parent), content(std::move(tag.name)) {} @@ -1860,7 +1860,7 @@ namespace stdex /// /// Parses HTML document source code /// - inline void assign(_In_reads_or_z_opt_(num_chars) const _Elem* source, _In_ size_t num_chars) + void assign(_In_reads_or_z_opt_(num_chars) const _Elem* source, _In_ size_t num_chars) { clear(); append(source, num_chars); @@ -1870,7 +1870,7 @@ namespace stdex /// /// Returns document HTML source code /// - inline const std::basic_string<_Elem, _Traits, _Alloc>& source() const { return m_source; } + const std::basic_string<_Elem, _Traits, _Alloc>& source() const { return m_source; } friend class parser<_Elem, _Traits, _Alloc>; @@ -1878,7 +1878,7 @@ namespace stdex /// /// Returns starting tag of currently active element or nullptr if no element is known to be started. /// - inline element_start* active_element() const + element_start* active_element() const { return m_element_stack.empty() ? nullptr : m_element_stack.back(); } @@ -1973,7 +1973,7 @@ namespace stdex class token { protected: - inline token(_In_ token_t _type = token_t::root, _In_opt_ sequence* _sequence = nullptr, _In_ uintptr_t _data = 0) : + token(_In_ token_t _type = token_t::root, _In_opt_ sequence* _sequence = nullptr, _In_ uintptr_t _data = 0) : type(_type), sequence(_sequence), data(_data) @@ -1993,7 +1993,7 @@ namespace stdex /// \returns Number of code units appended /// template, class _Alloc = std::allocator> - inline size_t append_tag(_Inout_ std::basic_string& str) const + size_t append_tag(_Inout_ std::basic_string& str) const { size_t n = str.size(); // Use %X instead of %p to ommit leading zeros and save space. @@ -2009,14 +2009,14 @@ namespace stdex /// \returns Number of code units appended /// template, class _Alloc = std::allocator> - inline size_t append_tag(_Inout_ std::basic_string& str) const + size_t append_tag(_Inout_ std::basic_string& str) const { // Use %X instead of %p to ommit leading zeros and save space. return stdex::appendf(str, L"%c%zX%c", stdex::locale_C.get(), static_cast(token_tag_start), reinterpret_cast(this), static_cast(token_tag_end)); } template - static inline token* parse_tag(const T* str, size_t& offset) + static token* parse_tag(const T* str, size_t& offset) { if (str[offset] != static_cast(token_tag_start)) return nullptr; @@ -2064,7 +2064,7 @@ namespace stdex class text_token : public token { protected: - inline text_token( + text_token( _In_ token_t type = token_t::complete, _In_reads_or_z_opt_(num_chars) const _Elem* _text = nullptr, _In_ size_t num_chars = 0, _In_ uint32_t _text_type = 0, @@ -2089,7 +2089,7 @@ namespace stdex class starting_token : public text_token<_Elem, _Traits, _Alloc> { protected: - inline starting_token( + starting_token( _In_reads_or_z_opt_(num_chars_text) const _Elem* _text = nullptr, _In_ size_t num_chars_text = 0, _In_reads_or_z_opt_(num_chars_name) const _Elem* _name = nullptr, _In_ size_t num_chars_name = 0, _In_ uint32_t text_type = 0, @@ -2124,7 +2124,7 @@ namespace stdex class url_token : public token { protected: - inline url_token( + url_token( _In_reads_or_z_opt_(num_chars) const _Elem* _url = nullptr, _In_ size_t num_chars = 0, token_url_t _encoding = token_url_t::plain, _In_opt_ stdex::html::sequence* sequence = nullptr, _In_ uintptr_t data = 0) : @@ -2156,7 +2156,7 @@ namespace stdex class parser { public: - inline parser( + parser( _In_ const document<_Elem, _Traits, _Alloc>& document, _In_reads_or_z_opt_(num_chars) const stdex::schar_t* url = nullptr, _In_ size_t num_chars = 0, _In_ bool parse_frames = false, _In_ stdex::progress* progress = nullptr) : @@ -2374,7 +2374,7 @@ namespace stdex /// /// Returns collection of tokens /// - inline const token_vector& tokens() const { return m_tokens; } + const token_vector& tokens() const { return m_tokens; } protected: /// @@ -2385,7 +2385,7 @@ namespace stdex /// \returns Pointer to the token for non-owning references /// template - inline T* append_token(_Inout_ std::unique_ptr&& token) + T* append_token(_Inout_ std::unique_ptr&& token) { if (!token) return nullptr; @@ -2403,7 +2403,7 @@ namespace stdex /// \returns Number of code units appended to the source code /// template - inline size_t append_token(_Inout_ std::unique_ptr&& token, _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& source) + size_t append_token(_Inout_ std::unique_ptr&& token, _Inout_ std::basic_string<_Elem, _Traits, _Alloc>& source) { if (!token) return 0; diff --git a/include/stdex/idrec.hpp b/include/stdex/idrec.hpp index f086b74d8..34bfabb61 100644 --- a/include/stdex/idrec.hpp +++ b/include/stdex/idrec.hpp @@ -25,7 +25,7 @@ namespace stdex { /// - \c false otherwise /// template - inline _Success_(return) bool read_id(_In_ std::istream& stream, _Out_ T_ID &id, _In_opt_ std::streamoff end = (std::streamoff)-1) + _Success_(return) bool read_id(_In_ std::istream& stream, _Out_ T_ID &id, _In_opt_ std::streamoff end = (std::streamoff)-1) { if (end == (std::streamoff)-1 || stream.tellg() < end) { stream.read((char*)&id, sizeof(id)); @@ -46,7 +46,7 @@ namespace stdex { /// - \c false otherwise /// template - inline _Success_(return) bool read_id(_In_ stdex::stream::basic_file& stream, _Out_ T_ID &id, _In_opt_ stdex::stream::fpos_t end = stdex::stream::fpos_max) + _Success_(return) bool read_id(_In_ stdex::stream::basic_file& stream, _Out_ T_ID &id, _In_opt_ stdex::stream::fpos_t end = stdex::stream::fpos_max) { if (end == stdex::stream::fpos_max || stream.tell() < end) { stream >> id; @@ -63,7 +63,7 @@ namespace stdex { /// \return Number of bytes needed to add to the data to align it on `ALIGN` boundary /// template - inline T_SIZE padding(_In_ T_SIZE size) + T_SIZE padding(_In_ T_SIZE size) { return (ALIGN - (size % ALIGN)) % ALIGN; } @@ -78,7 +78,7 @@ namespace stdex { /// - \c false otherwise /// template - inline bool ignore(_In_ std::istream& stream) + bool ignore(_In_ std::istream& stream) { // Read record size. T_SIZE size; @@ -103,7 +103,7 @@ namespace stdex { /// - \c false otherwise /// template - inline bool ignore(_In_ stdex::stream::basic& stream) + bool ignore(_In_ stdex::stream::basic& stream) { // Read record size. T_SIZE size; @@ -130,7 +130,7 @@ namespace stdex { /// - \c false otherwise /// template - inline bool find(_In_ std::istream& stream, _In_ T_ID id, _In_opt_ std::streamoff end = (std::streamoff)-1) + bool find(_In_ std::istream& stream, _In_ T_ID id, _In_opt_ std::streamoff end = (std::streamoff)-1) { T_ID _id; while (end == (std::streamoff)-1 || stream.tellg() < end) { @@ -157,7 +157,7 @@ namespace stdex { /// - \c false otherwise /// template - inline bool find(_In_ stdex::stream::basic_file& stream, _In_ T_ID id, _In_opt_ stdex::stream::fpos_t end = stdex::stream::fpos_max) + bool find(_In_ stdex::stream::basic_file& stream, _In_ T_ID id, _In_opt_ stdex::stream::fpos_t end = stdex::stream::fpos_max) { T_ID _id; while (end == stdex::stream::fpos_max || stream.tell() < end) { @@ -181,7 +181,7 @@ namespace stdex { /// \returns Position of the record header start in \p stream. Save for later \c close call. /// template - inline std::streamoff open(_In_ std::ostream& stream, _In_ T_ID id) + std::streamoff open(_In_ std::ostream& stream, _In_ T_ID id) { std::streamoff start = stream.tellp(); @@ -206,7 +206,7 @@ namespace stdex { /// \returns Position of the record header start in \p stream. Save for later \c close call. /// template - inline stdex::stream::fpos_t open(_In_ stdex::stream::basic_file& stream, _In_ T_ID id) + stdex::stream::fpos_t open(_In_ stdex::stream::basic_file& stream, _In_ T_ID id) { auto start = stream.tell(); @@ -228,7 +228,7 @@ namespace stdex { /// \returns Position of the record end in \p stream /// template - inline std::streamoff close(_In_ std::ostream& stream, _In_ std::streamoff start) + std::streamoff close(_In_ std::ostream& stream, _In_ std::streamoff start) { std::streamoff end = stream.tellp(); T_SIZE @@ -260,7 +260,7 @@ namespace stdex { /// \returns Position of the record end in \p stream /// template - inline stdex::stream::fpos_t close(_In_ stdex::stream::basic_file& stream, _In_ stdex::stream::fpos_t start) + stdex::stream::fpos_t close(_In_ stdex::stream::basic_file& stream, _In_ stdex::stream::fpos_t start) { auto end = stream.tell(); T_SIZE diff --git a/include/stdex/interval.hpp b/include/stdex/interval.hpp index 1100b6b62..e37877988 100644 --- a/include/stdex/interval.hpp +++ b/include/stdex/interval.hpp @@ -22,14 +22,14 @@ namespace stdex /// /// Constructs an invalid interval /// - inline interval() noexcept : start(static_cast(1)), end(static_cast(0)) {} + interval() noexcept : start(static_cast(1)), end(static_cast(0)) {} /// /// Constructs a zero-size interval /// /// \param[in] x Interval start and end value /// - inline interval(_In_ T x) noexcept : start(x), end(x) {} + interval(_In_ T x) noexcept : start(x), end(x) {} /// /// Constructs an interval @@ -37,26 +37,26 @@ namespace stdex /// \param[in] _start Interval start value /// \param[in] _end Interval end value /// - inline interval(_In_ T _start, _In_ T _end) noexcept : start(_start), end(_end) {} + interval(_In_ T _start, _In_ T _end) noexcept : start(_start), end(_end) {} /// /// Returns interval size /// /// \returns Interval size or 0 if interval is invalid /// - inline T size() const { return start <= end ? end - start : 0; } + T size() const { return start <= end ? end - start : 0; } /// /// Is interval empty? /// /// \returns true if interval is empty or false otherwise /// - inline bool empty() const { return start >= end; } + bool empty() const { return start >= end; } /// /// Invalidates interval /// - inline void invalidate() + void invalidate() { start = static_cast(1); end = static_cast(0); @@ -67,7 +67,7 @@ namespace stdex /// /// \returns true if interval is valid or false otherwise /// - inline operator bool() const { return start <= end; } + operator bool() const { return start <= end; } /// /// Is value in interval? @@ -76,7 +76,7 @@ namespace stdex /// /// \returns true if x is in [start, end) or false otherwise /// - inline bool contains(_In_ T x) const { return start <= x && x < end; } + bool contains(_In_ T x) const { return start <= x && x < end; } /// /// Adds two intervals by components @@ -85,7 +85,7 @@ namespace stdex /// /// \returns Resulting interval /// - inline interval operator+(_In_ const interval& other) const + interval operator+(_In_ const interval& other) const { return interval(start + other.start, end + other.end); } @@ -97,7 +97,7 @@ namespace stdex /// /// \returns Moved interval /// - inline interval operator+(_In_ const T x) const + interval operator+(_In_ const T x) const { return interval(start + x, end + x); } @@ -107,7 +107,7 @@ namespace stdex /// /// \returns Moved interval /// - inline interval operator++() + interval operator++() { ++start; ++end; @@ -119,7 +119,7 @@ namespace stdex /// /// \returns Original interval /// - inline interval operator++(int) // Postfix increment operator. + interval operator++(int) // Postfix increment operator. { interval r = *this; ++start; @@ -134,7 +134,7 @@ namespace stdex /// /// \returns Resulting interval /// - inline interval operator-(_In_ const interval& other) const + interval operator-(_In_ const interval& other) const { return interval(start - other.start, end - other.end); } @@ -146,7 +146,7 @@ namespace stdex /// /// \returns Moved interval /// - inline interval operator-(_In_ const T x) const + interval operator-(_In_ const T x) const { return interval(start - x, end - x); } @@ -156,7 +156,7 @@ namespace stdex /// /// \returns Moved interval /// - inline interval operator--() + interval operator--() { --start; --end; @@ -168,7 +168,7 @@ namespace stdex /// /// \returns Original interval /// - inline interval operator--(int) // Postfix decrement operator. + interval operator--(int) // Postfix decrement operator. { interval r = *this; --start; @@ -183,7 +183,7 @@ namespace stdex /// /// \returns true if intervals are identical or false otherwise /// - inline bool operator==(_In_ const interval& other) const + bool operator==(_In_ const interval& other) const { return start == other.start && end == other.end; } @@ -195,7 +195,7 @@ namespace stdex /// /// \returns true if intervals are different or false otherwise /// - inline bool operator!=(_In_ const interval& other) const + bool operator!=(_In_ const interval& other) const { return !operator ==(other); } diff --git a/include/stdex/mapping.hpp b/include/stdex/mapping.hpp index b349fa8e9..9613d554f 100644 --- a/include/stdex/mapping.hpp +++ b/include/stdex/mapping.hpp @@ -21,14 +21,14 @@ namespace stdex /// /// Constructs a zero to zero mapping /// - inline mapping() : from(0), to(0) {} + mapping() : from(0), to(0) {} /// /// Constructs an id mapping /// /// \param[in] x Mapping from and to value /// - inline mapping(_In_ T x) : from(x), to(x) {} + mapping(_In_ T x) : from(x), to(x) {} /// /// Constructs a mapping @@ -36,7 +36,7 @@ namespace stdex /// \param[in] _from Mapping from value /// \param[in] _to Mapping to value /// - inline mapping(_In_ T _from, _In_ T _to) : from(_from), to(_to) {} + mapping(_In_ T _from, _In_ T _to) : from(_from), to(_to) {} /// /// Are mappings identical? @@ -45,7 +45,7 @@ namespace stdex /// /// \returns true if mappings are identical or false otherwise /// - inline bool operator==(const mapping& other) const { return from == other.from && to == other.to; } + bool operator==(const mapping& other) const { return from == other.from && to == other.to; } /// /// Are mappings different? @@ -54,7 +54,7 @@ namespace stdex /// /// \returns true if mappings are different or false otherwise /// - inline bool operator!=(const mapping& other) const { return !operator==(other); } + bool operator!=(const mapping& other) const { return !operator==(other); } }; template >> diff --git a/include/stdex/memory.hpp b/include/stdex/memory.hpp index fa85f64a0..7c1d29017 100644 --- a/include/stdex/memory.hpp +++ b/include/stdex/memory.hpp @@ -18,9 +18,9 @@ namespace stdex constexpr no_delete() noexcept = default; template , int> = 0> - inline no_delete(const no_delete&) noexcept {} + no_delete(const no_delete&) noexcept {} - inline void operator()(T* p) const noexcept { _Unreferenced_(p); } + void operator()(T* p) const noexcept { _Unreferenced_(p); } }; /// @@ -31,10 +31,10 @@ namespace stdex constexpr no_delete() noexcept = default; template , int> = 0> - inline no_delete(const no_delete<_Uty[]>&) noexcept {} + no_delete(const no_delete<_Uty[]>&) noexcept {} template , int> = 0> - inline void operator()(_Uty* p) const noexcept { p; } + void operator()(_Uty* p) const noexcept { p; } }; /// @@ -46,7 +46,7 @@ namespace stdex /// \param[in] p Pointer to assign to shared_ptr /// template - inline std::shared_ptr make_shared_no_delete(_In_ T* p) + std::shared_ptr make_shared_no_delete(_In_ T* p) { return std::shared_ptr(p, no_delete{}); } diff --git a/include/stdex/parser.hpp b/include/stdex/parser.hpp index 3f1a2ec8c..4e1e0a5b2 100644 --- a/include/stdex/parser.hpp +++ b/include/stdex/parser.hpp @@ -95,7 +95,7 @@ namespace stdex _In_ int flags = match_default) = 0; template - inline bool match( + bool match( const std::basic_string& text, _In_ size_t start = 0, _In_ size_t end = SIZE_MAX, @@ -1128,7 +1128,7 @@ namespace stdex class basic_string_branch : public basic_branch { public: - inline basic_string_branch( + basic_string_branch( _In_reads_(count) const T* str_z = nullptr, _In_ size_t count = 0, _In_ const std::locale& locale = std::locale()) : @@ -1137,7 +1137,7 @@ namespace stdex build(str_z, count); } - inline basic_string_branch(_In_z_ const T* str, ...) : + basic_string_branch(_In_z_ const T* str, ...) : basic_branch(std::locale()) { va_list params; @@ -1146,7 +1146,7 @@ namespace stdex va_end(params); } - inline basic_string_branch(_In_ const std::locale& locale, _In_z_ const T* str, ...) : + basic_string_branch(_In_ const std::locale& locale, _In_z_ const T* str, ...) : basic_branch(locale) { va_list params; @@ -4233,7 +4233,7 @@ namespace stdex } protected: - static inline bool is_valid(size_t day, size_t month) + static bool is_valid(size_t day, size_t month) { if (month == SIZE_MAX) { // Default to January. This allows validating day only, as January has all 31 days. diff --git a/include/stdex/pool.hpp b/include/stdex/pool.hpp index 51dd57c7c..8065dac7f 100644 --- a/include/stdex/pool.hpp +++ b/include/stdex/pool.hpp @@ -37,7 +37,7 @@ namespace stdex std::map m_available; private: - static inline numaid_t numa_node() + static numaid_t numa_node() { #ifdef _WIN32 PROCESSOR_NUMBER Processor; @@ -49,7 +49,7 @@ namespace stdex #endif } - inline numaentry_t& numa_entry(numaid_t numa = numa_node()) + numaentry_t& numa_entry(numaid_t numa = numa_node()) { const std::lock_guard guard(m_mutex); return m_available[numa]; diff --git a/include/stdex/progress.hpp b/include/stdex/progress.hpp index 24b9bea97..91b0fc8e0 100644 --- a/include/stdex/progress.hpp +++ b/include/stdex/progress.hpp @@ -156,7 +156,7 @@ namespace stdex /// /// \param[in] host Host progress indicator /// - inline void attach(_In_opt_ progress* host) + void attach(_In_opt_ progress* host) { m_host = host; } @@ -166,7 +166,7 @@ namespace stdex /// /// \returns Old host progress indicator /// - inline progress* detach() + progress* detach() { progress* k = m_host; m_host = NULL; @@ -179,7 +179,7 @@ namespace stdex /// \param[in] start Minimum value of the progress /// \param[in] end Maximum value of the progress /// - inline void set_global_range(_In_ T start, _In_ T end) + void set_global_range(_In_ T start, _In_ T end) { m_global.start = start; m_global.end = end; @@ -193,7 +193,7 @@ namespace stdex /// \param[in] start Minimum value of the progress /// \param[in] end Maximum value of the progress /// - inline void set_section_range(_In_ T start, _In_ T end) + void set_section_range(_In_ T start, _In_ T end) { m_section.start = start; m_section.end = end; diff --git a/include/stdex/ring.hpp b/include/stdex/ring.hpp index 272512dc3..3d10474a8 100644 --- a/include/stdex/ring.hpp +++ b/include/stdex/ring.hpp @@ -123,18 +123,18 @@ namespace stdex } protected: - inline size_t wrap(_In_ size_t idx) const + size_t wrap(_In_ size_t idx) const { // TODO: When CAPACITY is power of 2, use & ~(CAPACITY - 1) instead. return idx % CAPACITY; } - inline size_t space() const + size_t space() const { return CAPACITY - m_size; } - inline bool empty() const + bool empty() const { return !m_size; } diff --git a/include/stdex/sgml.hpp b/include/stdex/sgml.hpp index f00d13079..2d8f8e814 100644 --- a/include/stdex/sgml.hpp +++ b/include/stdex/sgml.hpp @@ -17,7 +17,7 @@ namespace stdex { /// \cond internal template - inline const wchar_t* sgml2uni(_In_reads_or_z_(count) const T* entity, _In_ size_t count) + const wchar_t* sgml2uni(_In_reads_or_z_(count) const T* entity, _In_ size_t count) { _Assume_(entity && count); _Assume_(count < 2 || entity[0] != '#'); // No numeric entities @@ -44,7 +44,7 @@ namespace stdex } template - inline const T* sgmlend( + const T* sgmlend( _In_reads_or_z_opt_(count) const T* str, _In_ size_t count) { _Assume_(str || !count); @@ -88,7 +88,7 @@ namespace stdex /// \param[in,out] map The vector to append index mapping between source and destination string to. /// template - inline void sgml2strcat( + void sgml2strcat( _Inout_ std::wstring& dst, _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src, _In_ int skip = 0, @@ -180,7 +180,7 @@ namespace stdex /// \param[in,out] map The vector to append index mapping between source and destination string to. /// template - inline void sgml2strcat( + void sgml2strcat( _Inout_ std::wstring& dst, _In_ const std::basic_string& src, _In_ int skip = 0, @@ -204,7 +204,7 @@ namespace stdex /// \return Final length of SGML string in code points excluding zero-terminator /// template - inline size_t sgml2strcat( + size_t sgml2strcat( _Inout_cap_(count_dst) wchar_t* dst, _In_ size_t count_dst, _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src, _In_ int skip = 0, @@ -308,7 +308,7 @@ namespace stdex /// \param[in,out] map The vector to write index mapping between source and destination string to. /// template - inline void sgml2strcpy( + void sgml2strcpy( _Inout_ std::wstring& dst, _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src, _In_ int skip = 0, @@ -331,7 +331,7 @@ namespace stdex /// \param[in,out] map The vector to write index mapping between source and destination string to. /// template - inline void sgml2strcpy( + void sgml2strcpy( _Inout_ std::wstring& dst, _In_ const std::basic_string<_Elem, _Traits, _Ax>& src, _In_ int skip = 0, @@ -355,7 +355,7 @@ namespace stdex /// \return Final length of SGML string in code points excluding zero-terminator /// template - inline size_t sgml2strcpy( + size_t sgml2strcpy( _Inout_cap_(count_dst) wchar_t* dst, _In_ size_t count_dst, _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src, _In_ int skip = 0, @@ -382,7 +382,7 @@ namespace stdex /// \return Unicode string /// template - inline std::wstring sgml2str( + std::wstring sgml2str( _In_reads_or_z_opt_(count_src) const T* src, _In_ size_t count_src, _In_ int skip = 0, _In_ const mapping& offset = mapping(0, 0), @@ -404,7 +404,7 @@ namespace stdex /// \return Unicode string /// template - inline std::wstring sgml2str( + std::wstring sgml2str( _In_ const std::basic_string& src, _In_ int skip = 0, _In_ const mapping& offset = mapping(0, 0), diff --git a/include/stdex/stream.hpp b/include/stdex/stream.hpp index 861ca19dd..809ed0c48 100644 --- a/include/stdex/stream.hpp +++ b/include/stdex/stream.hpp @@ -167,12 +167,12 @@ namespace stdex /// /// Returns stream state after last operation /// - inline state_t state() const { return m_state; }; + state_t state() const { return m_state; }; /// /// Returns true if the stream state is clean i.e. previous operation was succesful /// - inline bool ok() const { return m_state == state_t::ok; }; + bool ok() const { return m_state == state_t::ok; }; /// /// Reads and returns remainder of the stream @@ -207,7 +207,7 @@ namespace stdex /// /// Reads one byte of data /// - inline uint8_t read_byte() + uint8_t read_byte() { uint8_t byte; if (read_array(&byte, sizeof(byte), 1) == 1) @@ -256,7 +256,7 @@ namespace stdex /// \returns This stream /// template - inline basic& read_data(_Out_ T& data) + basic& read_data(_Out_ T& data) { if (!ok()) _Unlikely_ { data = 0; @@ -284,7 +284,7 @@ namespace stdex /// \return This stream /// template - inline basic& write_data(_In_ const T data) + basic& write_data(_In_ const T data) { if (!ok()) _Unlikely_ return *this; @@ -303,7 +303,7 @@ namespace stdex /// \return Number of read characters /// template, class _Ax = std::allocator<_Elem>> - inline size_t readln(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str) + size_t readln(_Inout_ std::basic_string<_Elem, _Traits, _Ax>& str) { str.clear(); return readln_and_attach(str); @@ -385,7 +385,7 @@ namespace stdex /// /// \return Number of elements written /// - inline size_t write_array(_In_reads_bytes_opt_(size* count) const void* array, _In_ size_t size, _In_ size_t count) + size_t write_array(_In_reads_bytes_opt_(size* count) const void* array, _In_ size_t size, _In_ size_t count) { return write(array, mul(size, count)) / size; } @@ -462,7 +462,7 @@ namespace stdex /// \return This stream /// template, class _Ax = std::allocator<_Elem>> - inline basic& read_str(_Out_ std::basic_string<_Elem, _Traits, _Ax>& data) + basic& read_str(_Out_ std::basic_string<_Elem, _Traits, _Ax>& data) { data.clear(); if (!ok()) _Unlikely_ @@ -494,7 +494,7 @@ namespace stdex /// \return This stream /// template - inline basic& write_str(_In_z_ const T* data) + basic& write_str(_In_z_ const T* data) { // Stream state will be checked in write_data. size_t num_chars = stdex::strlen(data); @@ -519,7 +519,7 @@ namespace stdex /// \return This stream /// template, class _Ax = std::allocator<_Elem>> - inline basic& write_str(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data) + basic& write_str(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data) { // Stream state will be checked in write_data. size_t num_chars = data.size(); @@ -643,38 +643,38 @@ namespace stdex return write_array(tmp.data(), sizeof(wchar_t), tmp.size()); } - inline basic& operator >>(_Out_ int8_t& data) { return read_data(data); } - inline basic& operator <<(_In_ const int8_t data) { return write_data(data); } - inline basic& operator >>(_Out_ int16_t& data) { return read_data(data); } - inline basic& operator <<(_In_ const int16_t data) { return write_data(data); } - inline basic& operator >>(_Out_ int32_t& data) { return read_data(data); } - inline basic& operator <<(_In_ const int32_t data) { return write_data(data); } - inline basic& operator >>(_Out_ int64_t& data) { return read_data(data); } - inline basic& operator <<(_In_ const int64_t data) { return write_data(data); } - inline basic& operator >>(_Out_ uint8_t& data) { return read_data(data); } - inline basic& operator <<(_In_ const uint8_t data) { return write_data(data); } - inline basic& operator >>(_Out_ uint16_t& data) { return read_data(data); } - inline basic& operator <<(_In_ const uint16_t data) { return write_data(data); } - inline basic& operator >>(_Out_ uint32_t& data) { return read_data(data); } - inline basic& operator <<(_In_ const uint32_t data) { return write_data(data); } - inline basic& operator >>(_Out_ uint64_t& data) { return read_data(data); } - inline basic& operator <<(_In_ const uint64_t data) { return write_data(data); } - inline basic& operator >>(_Out_ float& data) { return read_data(data); } - inline basic& operator <<(_In_ const float data) { return write_data(data); } - inline basic& operator >>(_Out_ double& data) { return read_data(data); } - inline basic& operator <<(_In_ const double data) { return write_data(data); } - inline basic& operator >>(_Out_ char& data) { return read_data(data); } - inline basic& operator <<(_In_ const char data) { return write_data(data); } + basic& operator >>(_Out_ int8_t& data) { return read_data(data); } + basic& operator <<(_In_ const int8_t data) { return write_data(data); } + basic& operator >>(_Out_ int16_t& data) { return read_data(data); } + basic& operator <<(_In_ const int16_t data) { return write_data(data); } + basic& operator >>(_Out_ int32_t& data) { return read_data(data); } + basic& operator <<(_In_ const int32_t data) { return write_data(data); } + basic& operator >>(_Out_ int64_t& data) { return read_data(data); } + basic& operator <<(_In_ const int64_t data) { return write_data(data); } + basic& operator >>(_Out_ uint8_t& data) { return read_data(data); } + basic& operator <<(_In_ const uint8_t data) { return write_data(data); } + basic& operator >>(_Out_ uint16_t& data) { return read_data(data); } + basic& operator <<(_In_ const uint16_t data) { return write_data(data); } + basic& operator >>(_Out_ uint32_t& data) { return read_data(data); } + basic& operator <<(_In_ const uint32_t data) { return write_data(data); } + basic& operator >>(_Out_ uint64_t& data) { return read_data(data); } + basic& operator <<(_In_ const uint64_t data) { return write_data(data); } + basic& operator >>(_Out_ float& data) { return read_data(data); } + basic& operator <<(_In_ const float data) { return write_data(data); } + basic& operator >>(_Out_ double& data) { return read_data(data); } + basic& operator <<(_In_ const double data) { return write_data(data); } + basic& operator >>(_Out_ char& data) { return read_data(data); } + basic& operator <<(_In_ const char data) { return write_data(data); } #ifdef _NATIVE_WCHAR_T_DEFINED - inline basic& operator >>(_Out_ wchar_t& data) { return read_data(data); } - inline basic& operator <<(_In_ const wchar_t data) { return write_data(data); } + basic& operator >>(_Out_ wchar_t& data) { return read_data(data); } + basic& operator <<(_In_ const wchar_t data) { return write_data(data); } #endif template, class _Ax = std::allocator<_Elem>> - inline basic& operator >>(_Out_ std::basic_string<_Elem, _Traits, _Ax>& data) { return read_str(data); } + basic& operator >>(_Out_ std::basic_string<_Elem, _Traits, _Ax>& data) { return read_str(data); } template - inline basic& operator <<(_In_ const T* data) { return write_str(data); } + basic& operator <<(_In_ const T* data) { return write_str(data); } template, class _Ax = std::allocator<_Elem>> - inline basic& operator <<(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data) { return write_str(data); } + basic& operator <<(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data) { return write_str(data); } template > basic& operator <<(_In_ const std::vector<_Ty, _Alloc>& data) @@ -836,21 +836,21 @@ namespace stdex /// /// \return Absolute file position after seek /// - inline fpos_t seekbeg(_In_ fpos_t offset) { return seek(offset, seek_t::beg); } + fpos_t seekbeg(_In_ fpos_t offset) { return seek(offset, seek_t::beg); } /// /// Seeks to relative from current file position /// /// \return Absolute file position after seek /// - inline fpos_t seekcur(_In_ foff_t offset) { return seek(offset, seek_t::cur); } + fpos_t seekcur(_In_ foff_t offset) { return seek(offset, seek_t::cur); } /// /// Seeks to relative from end file position /// /// \return Absolute file position after seek /// - inline fpos_t seekend(_In_ foff_t offset) { return seek(offset, seek_t::end); } + fpos_t seekend(_In_ foff_t offset) { return seek(offset, seek_t::end); } virtual void skip(_In_ fsize_t amount) { @@ -2393,12 +2393,12 @@ namespace stdex /// /// Returns true if socket handle is valid /// - inline operator bool() const noexcept { return m_h != invalid_socket; } + operator bool() const noexcept { return m_h != invalid_socket; } /// /// Returns socket handle /// - inline socket_t get() const noexcept { return m_h; } + socket_t get() const noexcept { return m_h; } virtual _Success_(return != 0 || length == 0) size_t read( _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length) @@ -2707,7 +2707,7 @@ namespace stdex /// \param[in] filename Filename /// \param[in] mode Bitwise combination of mode_t flags /// - inline file(_In_ const stdex::sstring& filename, _In_ int mode) : file(filename.c_str(), mode) {} + file(_In_ const stdex::sstring& filename, _In_ int mode) : file(filename.c_str(), mode) {} /// /// Opens file @@ -2788,7 +2788,7 @@ namespace stdex /// \param[in] filename Filename /// \param[in] mode Bitwise combination of mode_t flags /// - inline void open(_In_ const stdex::sstring& filename, _In_ int mode) + void open(_In_ const stdex::sstring& filename, _In_ int mode) { open(filename.c_str(), mode); } @@ -2893,10 +2893,10 @@ namespace stdex if (orig >= 0) { length = lseek64(m_h, 0, SEEK_END); lseek64(m_h, orig, SEEK_SET); - } - return length; + } + return length; #endif - } + } virtual void truncate() { @@ -2916,7 +2916,7 @@ namespace stdex } #ifdef _WIN32 - static inline time_point ft2tp(_In_ const FILETIME& ft) + static time_point ft2tp(_In_ const FILETIME& ft) { #if _HAS_CXX20 uint64_t t = (static_cast(ft.dwHighDateTime) << 32) | ft.dwLowDateTime; @@ -2926,7 +2926,7 @@ namespace stdex return time_point(time_point::duration(t)); } - static inline void tp2ft(_In_ time_point tp, _Out_ FILETIME& ft) + static void tp2ft(_In_ time_point tp, _Out_ FILETIME& ft) { #if _HAS_CXX20 uint64_t t = tp.time_since_epoch().count(); @@ -3049,7 +3049,7 @@ namespace stdex /// /// \param[in] filename Filename /// - static inline bool exists(_In_ const stdex::sstring& filename) + static bool exists(_In_ const stdex::sstring& filename) { return exists(filename.c_str()); } @@ -3079,7 +3079,7 @@ namespace stdex /// /// \param[in] filename Filename /// - static inline bool readonly(_In_ const stdex::sstring& filename) + static bool readonly(_In_ const stdex::sstring& filename) { return readonly(filename.c_str()); } @@ -3120,7 +3120,7 @@ namespace stdex /// \param[in] mode Bitwise combination of mode_t flags /// \param[in] cache_size Size of the cache block /// - inline cached_file(_In_ const stdex::sstring& filename, _In_ int mode, _In_ size_t cache_size = default_cache_size) : cached_file(filename.c_str(), mode, cache_size) {} + cached_file(_In_ const stdex::sstring& filename, _In_ int mode, _In_ size_t cache_size = default_cache_size) : cached_file(filename.c_str(), mode, cache_size) {} virtual ~cached_file() { @@ -3154,7 +3154,7 @@ namespace stdex /// \param[in] filename Filename /// \param[in] mode Bitwise combination of mode_t flags /// - inline void open(_In_ const stdex::sstring& filename, _In_ int mode) + void open(_In_ const stdex::sstring& filename, _In_ int mode) { open(filename.c_str(), mode); } @@ -3162,7 +3162,7 @@ namespace stdex /// /// Returns true if file has a valid handle /// - inline operator bool() const noexcept { return m_source; } + operator bool() const noexcept { return m_source; } protected: file m_source; @@ -3263,7 +3263,7 @@ namespace stdex /// \param[in] filename Filename /// \param[in] mode Bitwise combination of mode_t flags /// - inline memory_file(_In_ const stdex::sstring& filename, _In_ int mode) : memory_file(filename.c_str(), mode) {} + memory_file(_In_ const stdex::sstring& filename, _In_ int mode) : memory_file(filename.c_str(), mode) {} /// /// Copies content from another file @@ -3454,7 +3454,7 @@ namespace stdex /// \param[in] filename Filename /// \param[in] mode Bitwise combination of mode_t flags /// - inline void load(_In_ const stdex::sstring& filename, _In_ int mode) + void load(_In_ const stdex::sstring& filename, _In_ int mode) { load(filename.c_str(), mode); } @@ -3491,7 +3491,7 @@ namespace stdex /// \param[in] filename Filename /// \param[in] mode Bitwise combination of mode_t flags /// - inline void save(_In_ const stdex::sstring& filename, _In_ int mode) + void save(_In_ const stdex::sstring& filename, _In_ int mode) { save(filename.c_str(), mode); } @@ -3499,7 +3499,7 @@ namespace stdex /// /// Returns pointer to data /// - inline const void* data() const { return m_data; } + const void* data() const { return m_data; } virtual _Success_(return != 0 || length == 0) size_t read( _Out_writes_bytes_to_opt_(length, return) void* data, _In_ size_t length) @@ -3540,7 +3540,7 @@ namespace stdex /// \returns This stream /// template - inline memory_file& read_data(_Out_ T& data) + memory_file& read_data(_Out_ T& data) { #if SET_FILE_OP_TIMES m_atime = time_point::now(); @@ -3668,7 +3668,7 @@ namespace stdex /// \returns This stream /// template - inline memory_file& write_data(const T data) + memory_file& write_data(const T data) { #if SET_FILE_OP_TIMES m_atime = m_mtime = time_point::now(); @@ -3706,7 +3706,7 @@ namespace stdex /// \return This stream /// template - inline memory_file& write_str(_In_z_ const T * data) + memory_file& write_str(_In_z_ const T * data) { #if SET_FILE_OP_TIMES m_atime = m_mtime = time_point::now(); @@ -3751,7 +3751,7 @@ namespace stdex /// \return This stream /// template, class _Ax = std::allocator<_Elem>> - inline memory_file& write_str(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data) + memory_file& write_str(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data) { #if SET_FILE_OP_TIMES m_atime = m_mtime = time_point::now(); @@ -3927,7 +3927,7 @@ namespace stdex /// \param[in] data Data to write /// template - inline void set(_In_ fpos_t offset, _In_ const T data) + void set(_In_ fpos_t offset, _In_ const T data) { #if SET_FILE_OP_TIMES m_atime = m_mtime = time_point::now(); @@ -3937,19 +3937,19 @@ namespace stdex } public: - inline void set(_In_ fpos_t offset, _In_ const int8_t data) { set(offset, data); } - inline void set(_In_ fpos_t offset, _In_ const int16_t data) { set(offset, data); } - inline void set(_In_ fpos_t offset, _In_ const int32_t data) { set(offset, data); } - inline void set(_In_ fpos_t offset, _In_ const int64_t data) { set(offset, data); } - inline void set(_In_ fpos_t offset, _In_ const uint8_t data) { set(offset, data); } - inline void set(_In_ fpos_t offset, _In_ const uint16_t data) { set(offset, data); } - inline void set(_In_ fpos_t offset, _In_ const uint32_t data) { set(offset, data); } - inline void set(_In_ fpos_t offset, _In_ const uint64_t data) { set(offset, data); } - inline void set(_In_ fpos_t offset, _In_ const float data) { set(offset, data); } - inline void set(_In_ fpos_t offset, _In_ const double data) { set(offset, data); } - inline void set(_In_ fpos_t offset, _In_ const char data) { set(offset, data); } + void set(_In_ fpos_t offset, _In_ const int8_t data) { set(offset, data); } + void set(_In_ fpos_t offset, _In_ const int16_t data) { set(offset, data); } + void set(_In_ fpos_t offset, _In_ const int32_t data) { set(offset, data); } + void set(_In_ fpos_t offset, _In_ const int64_t data) { set(offset, data); } + void set(_In_ fpos_t offset, _In_ const uint8_t data) { set(offset, data); } + void set(_In_ fpos_t offset, _In_ const uint16_t data) { set(offset, data); } + void set(_In_ fpos_t offset, _In_ const uint32_t data) { set(offset, data); } + void set(_In_ fpos_t offset, _In_ const uint64_t data) { set(offset, data); } + void set(_In_ fpos_t offset, _In_ const float data) { set(offset, data); } + void set(_In_ fpos_t offset, _In_ const double data) { set(offset, data); } + void set(_In_ fpos_t offset, _In_ const char data) { set(offset, data); } #ifdef _NATIVE_WCHAR_T_DEFINED - inline void set(_In_ fpos_t offset, _In_ const wchar_t data) { set(offset, data); } + void set(_In_ fpos_t offset, _In_ const wchar_t data) { set(offset, data); } #endif /// @@ -3961,7 +3961,7 @@ namespace stdex /// protected: template - inline void get(_In_ fpos_t offset, _Out_ T & data) + void get(_In_ fpos_t offset, _Out_ T & data) { _Assume_(offset + sizeof(T) < m_size); data = LE2HE(*(T*)(m_data + offset)); @@ -3971,53 +3971,53 @@ namespace stdex } public: - inline void get(_In_ fpos_t offset, _Out_ int8_t & data) { get(offset, data); } - inline void get(_In_ fpos_t offset, _Out_ int16_t & data) { get(offset, data); } - inline void get(_In_ fpos_t offset, _Out_ int32_t & data) { get(offset, data); } - inline void get(_In_ fpos_t offset, _Out_ int64_t & data) { get(offset, data); } - inline void get(_In_ fpos_t offset, _Out_ uint8_t & data) { get(offset, data); } - inline void get(_In_ fpos_t offset, _Out_ uint16_t & data) { get(offset, data); } - inline void get(_In_ fpos_t offset, _Out_ uint32_t & data) { get(offset, data); } - inline void get(_In_ fpos_t offset, _Out_ uint64_t & data) { get(offset, data); } - inline void get(_In_ fpos_t offset, _Out_ float& data) { get(offset, data); } - inline void get(_In_ fpos_t offset, _Out_ double& data) { get(offset, data); } - inline void get(_In_ fpos_t offset, _Out_ char& data) { get(offset, data); } + void get(_In_ fpos_t offset, _Out_ int8_t & data) { get(offset, data); } + void get(_In_ fpos_t offset, _Out_ int16_t & data) { get(offset, data); } + void get(_In_ fpos_t offset, _Out_ int32_t & data) { get(offset, data); } + void get(_In_ fpos_t offset, _Out_ int64_t & data) { get(offset, data); } + void get(_In_ fpos_t offset, _Out_ uint8_t & data) { get(offset, data); } + void get(_In_ fpos_t offset, _Out_ uint16_t & data) { get(offset, data); } + void get(_In_ fpos_t offset, _Out_ uint32_t & data) { get(offset, data); } + void get(_In_ fpos_t offset, _Out_ uint64_t & data) { get(offset, data); } + void get(_In_ fpos_t offset, _Out_ float& data) { get(offset, data); } + void get(_In_ fpos_t offset, _Out_ double& data) { get(offset, data); } + void get(_In_ fpos_t offset, _Out_ char& data) { get(offset, data); } #ifdef _NATIVE_WCHAR_T_DEFINED - inline void get(_In_ fpos_t offset, _Out_ wchar_t& data) { get(offset, data); } + void get(_In_ fpos_t offset, _Out_ wchar_t& data) { get(offset, data); } #endif - inline memory_file& operator <<(_In_ const int8_t data) { return write_data(data); } - inline memory_file& operator >>(_Out_ int8_t & data) { return read_data(data); } - inline memory_file& operator <<(_In_ const int16_t data) { return write_data(data); } - inline memory_file& operator >>(_Out_ int16_t & data) { return read_data(data); } - inline memory_file& operator <<(_In_ const int32_t data) { return write_data(data); } - inline memory_file& operator >>(_Out_ int32_t & data) { return read_data(data); } - inline memory_file& operator <<(_In_ const int64_t data) { return write_data(data); } - inline memory_file& operator >>(_Out_ int64_t & data) { return read_data(data); } - inline memory_file& operator <<(_In_ const uint8_t data) { return write_data(data); } - inline memory_file& operator >>(_Out_ uint8_t & data) { return read_data(data); } - inline memory_file& operator <<(_In_ const uint16_t data) { return write_data(data); } - inline memory_file& operator >>(_Out_ uint16_t & data) { return read_data(data); } - inline memory_file& operator <<(_In_ const uint32_t data) { return write_data(data); } - inline memory_file& operator >>(_Out_ uint32_t & data) { return read_data(data); } - inline memory_file& operator <<(_In_ const uint64_t data) { return write_data(data); } - inline memory_file& operator >>(_Out_ uint64_t & data) { return read_data(data); } - inline memory_file& operator <<(_In_ const float data) { return write_data(data); } - inline memory_file& operator >>(_Out_ float& data) { return read_data(data); } - inline memory_file& operator <<(_In_ const double data) { return write_data(data); } - inline memory_file& operator >>(_Out_ double& data) { return read_data(data); } - inline memory_file& operator <<(_In_ const char data) { return write_data(data); } - inline memory_file& operator >>(_Out_ char& data) { return read_data(data); } + memory_file& operator <<(_In_ const int8_t data) { return write_data(data); } + memory_file& operator >>(_Out_ int8_t & data) { return read_data(data); } + memory_file& operator <<(_In_ const int16_t data) { return write_data(data); } + memory_file& operator >>(_Out_ int16_t & data) { return read_data(data); } + memory_file& operator <<(_In_ const int32_t data) { return write_data(data); } + memory_file& operator >>(_Out_ int32_t & data) { return read_data(data); } + memory_file& operator <<(_In_ const int64_t data) { return write_data(data); } + memory_file& operator >>(_Out_ int64_t & data) { return read_data(data); } + memory_file& operator <<(_In_ const uint8_t data) { return write_data(data); } + memory_file& operator >>(_Out_ uint8_t & data) { return read_data(data); } + memory_file& operator <<(_In_ const uint16_t data) { return write_data(data); } + memory_file& operator >>(_Out_ uint16_t & data) { return read_data(data); } + memory_file& operator <<(_In_ const uint32_t data) { return write_data(data); } + memory_file& operator >>(_Out_ uint32_t & data) { return read_data(data); } + memory_file& operator <<(_In_ const uint64_t data) { return write_data(data); } + memory_file& operator >>(_Out_ uint64_t & data) { return read_data(data); } + memory_file& operator <<(_In_ const float data) { return write_data(data); } + memory_file& operator >>(_Out_ float& data) { return read_data(data); } + memory_file& operator <<(_In_ const double data) { return write_data(data); } + memory_file& operator >>(_Out_ double& data) { return read_data(data); } + memory_file& operator <<(_In_ const char data) { return write_data(data); } + memory_file& operator >>(_Out_ char& data) { return read_data(data); } #ifdef _NATIVE_WCHAR_T_DEFINED - inline memory_file& operator <<(_In_ const wchar_t data) { return write_data(data); } - inline memory_file& operator >>(_Out_ wchar_t& data) { return read_data(data); } + memory_file& operator <<(_In_ const wchar_t data) { return write_data(data); } + memory_file& operator >>(_Out_ wchar_t& data) { return read_data(data); } #endif template, class _Ax = std::allocator<_Elem>> - inline memory_file& operator >>(_Out_ std::basic_string<_Elem, _Traits, _Ax>&data) { return read_str(data); } + memory_file& operator >>(_Out_ std::basic_string<_Elem, _Traits, _Ax>&data) { return read_str(data); } template - inline memory_file& operator <<(_In_ const T * data) { return write_str(data); } + memory_file& operator <<(_In_ const T * data) { return write_str(data); } template, class _Ax = std::allocator<_Elem>> - inline memory_file& operator <<(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data) { return write_str(data); } + memory_file& operator <<(_In_ const std::basic_string<_Elem, _Traits, _Ax>& data) { return write_str(data); } protected: uint8_t* m_data; ///< file data @@ -4120,7 +4120,7 @@ namespace stdex /// /// Returns total size of pending data in the queue /// - inline size_t size() const { return m_size; }; + size_t size() const { return m_size; }; protected: size_t m_offset, m_size; diff --git a/include/stdex/system.hpp b/include/stdex/system.hpp index becf21586..5f9b82b21 100644 --- a/include/stdex/system.hpp +++ b/include/stdex/system.hpp @@ -142,12 +142,12 @@ namespace stdex /// /// Returns true if object has a valid handle /// - inline operator bool() const noexcept { return m_h != invalid_handle; } + operator bool() const noexcept { return m_h != invalid_handle; } /// /// Returns object handle /// - inline sys_handle get() const noexcept { return m_h; } + sys_handle get() const noexcept { return m_h; } protected: /// diff --git a/include/stdex/unicode.hpp b/include/stdex/unicode.hpp index b9069fb73..b897a3bc3 100644 --- a/include/stdex/unicode.hpp +++ b/include/stdex/unicode.hpp @@ -70,7 +70,7 @@ namespace stdex inline charset_id charset_from_name(_In_z_ const char* name) { struct charset_less { - inline bool operator()(_In_z_ const char* a, _In_z_ const char* b) const + bool operator()(_In_z_ const char* a, _In_z_ const char* b) const { return stdex::stricmp(a, b) < 0; } @@ -120,7 +120,7 @@ namespace stdex /// Charset name /// Charset code or `charset_id::system` if match not found template , class _Alloc = std::allocator> - inline charset_id charset_from_name(_In_ const std::basic_string& name) + charset_id charset_from_name(_In_ const std::basic_string& name) { return charset_from_name(name.c_str()); } @@ -156,8 +156,8 @@ namespace stdex } #endif - inline charset_id from_encoding() const { return m_from; } - inline charset_id to_encoding() const { return m_to; } + charset_id from_encoding() const { return m_from; } + charset_id to_encoding() const { return m_to; } /// /// Convert string and append to string @@ -309,7 +309,7 @@ namespace stdex /// \param[in] src Zero-terminated string to convert /// template , class _Alloc_to = std::allocator> - inline void strcat( + void strcat( _Inout_ std::basic_string& dst, _In_z_ const T_from* src) { @@ -323,7 +323,7 @@ namespace stdex /// \param[in] src String to convert /// template , class _Alloc_to = std::allocator, class _Traits_from = std::char_traits, class _Alloc_from = std::allocator> - inline void strcat( + void strcat( _Inout_ std::basic_string& dst, _In_ const std::basic_string& src) { @@ -338,7 +338,7 @@ namespace stdex /// \param[in] count_src String to convert code unit limit /// template , class _Alloc_to = std::allocator> - inline void strcpy( + void strcpy( _Inout_ std::basic_string& dst, _In_reads_or_z_opt_(count_src) const T_from* src, _In_ size_t count_src) { @@ -353,7 +353,7 @@ namespace stdex /// \param[in] src Zero-terminated string to convert /// template , class _Alloc_to = std::allocator> - inline void strcpy( + void strcpy( _Inout_ std::basic_string& dst, _In_z_ const T_from* src) { @@ -367,7 +367,7 @@ namespace stdex /// \param[in] src String to convert /// template , class _Alloc_to = std::allocator, class _Traits_from = std::char_traits, class _Alloc_from = std::allocator> - inline void strcpy( + void strcpy( _Inout_ std::basic_string& dst, _In_ const std::basic_string& src) { @@ -381,7 +381,7 @@ namespace stdex /// \param[in] count_src String to convert code unit limit /// template , class _Alloc_to = std::allocator> - inline std::basic_string convert(_In_reads_or_z_opt_(count_src) const T_from* src, _In_ size_t count_src) + std::basic_string convert(_In_reads_or_z_opt_(count_src) const T_from* src, _In_ size_t count_src) { std::basic_string dst; strcat(dst, src, count_src); @@ -394,7 +394,7 @@ namespace stdex /// \param[in] src Zero-terminated string to convert /// template , class _Alloc_to = std::allocator> - inline std::basic_string convert(_In_z_ const T_from* src) + std::basic_string convert(_In_z_ const T_from* src) { return convert(src, SIZE_MAX); } @@ -405,12 +405,12 @@ namespace stdex /// \param[in] src String to convert /// template , class _Alloc_to = std::allocator, class _Traits_from = std::char_traits, class _Alloc_from = std::allocator> - inline std::basic_string convert(_In_ const std::basic_string& src) + std::basic_string convert(_In_ const std::basic_string& src) { return convert(src.data(), src.size()); } - inline void clear() + void clear() { #ifndef _WIN32 iconv(m_handle, NULL, NULL, NULL, NULL); @@ -810,7 +810,7 @@ namespace stdex /// \return Number of code units excluding zero terminator in the dst string after the operation. /// template , class _Alloc = std::allocator> - inline size_t normalizecat( + size_t normalizecat( _Inout_ std::basic_string& dst, _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src) { @@ -837,7 +837,7 @@ namespace stdex /// \return Number of code units excluding zero terminator in the dst string after the operation. /// template , class _Alloc = std::allocator> - inline size_t normalizecat( + size_t normalizecat( _Inout_ std::basic_string& dst, _In_ const wchar_t (&src)[_Size]) { @@ -853,7 +853,7 @@ namespace stdex /// \return Number of code units excluding zero terminator in the dst string after the operation. /// template , class _Alloc_dst = std::allocator, class _Traits_src = std::char_traits, class _Alloc_src = std::allocator> - inline size_t normalizecat( + size_t normalizecat( _Inout_ std::basic_string& dst, _In_ const std::basic_string& src) { @@ -870,7 +870,7 @@ namespace stdex /// \return Number of code units excluding zero terminator in the dst string after the operation. /// template , class _Alloc = std::allocator> - inline size_t normalize( + size_t normalize( _Inout_ std::basic_string& dst, _In_reads_or_z_opt_(count_src) const wchar_t* src, _In_ size_t count_src) { @@ -887,7 +887,7 @@ namespace stdex /// \return Number of code units excluding zero terminator in the dst string after the operation. /// template , class _Alloc = std::allocator> - inline size_t normalize( + size_t normalize( _Inout_ std::basic_string& dst, _In_ const wchar_t(&src)[_Size]) { @@ -903,7 +903,7 @@ namespace stdex /// \return Number of code units excluding zero terminator in the dst string after the operation. /// template , class _Alloc_dst = std::allocator, class _Traits_src = std::char_traits, class _Alloc_src = std::allocator> - inline size_t normalize( + size_t normalize( _Inout_ std::basic_string& dst, _In_ const std::basic_string& src) { @@ -933,7 +933,7 @@ namespace stdex /// \return Normalized string /// template - inline std::wstring normalize(_In_ const wchar_t(&src)[_Size]) + std::wstring normalize(_In_ const wchar_t(&src)[_Size]) { std::wstring dst; normalizecat(dst, src, _Size); @@ -948,7 +948,7 @@ namespace stdex /// \return Normalized string /// template , class _Alloc = std::allocator> - inline std::wstring normalize(_In_ const std::basic_string& src) + std::wstring normalize(_In_ const std::basic_string& src) { std::wstring dst; normalizecat(dst, src.data(), src.size()); diff --git a/include/stdex/wav.hpp b/include/stdex/wav.hpp index 28b15916c..c1f95b45a 100644 --- a/include/stdex/wav.hpp +++ b/include/stdex/wav.hpp @@ -455,7 +455,7 @@ namespace stdex } template - inline _Success_(return!=0) bool find_first( + _Success_(return!=0) bool find_first( _In_ stdex::stream::basic_file& dat, _In_ id_t subid, _In_ stdex::stream::fpos_t block_end = stdex::stream::fpos_max, @@ -487,7 +487,7 @@ namespace stdex } template - inline _Success_(return != 0) bool read_first( + _Success_(return != 0) bool read_first( _In_ stdex::stream::basic_file& dat, _Inout_ T& content, _In_ stdex::stream::fpos_t block_end = stdex::stream::fpos_max)