diff --git a/examples/http_async_server.hpp b/examples/http_async_server.hpp index 791e6bf7..44b80812 100644 --- a/examples/http_async_server.hpp +++ b/examples/http_async_server.hpp @@ -160,7 +160,7 @@ private: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, write_op* op) { diff --git a/extras/beast/unit_test/amount.hpp b/extras/beast/unit_test/amount.hpp index b4c1f72e..01a1e522 100644 --- a/extras/beast/unit_test/amount.hpp +++ b/extras/beast/unit_test/amount.hpp @@ -26,7 +26,7 @@ public: amount (amount const&) = default; amount& operator= (amount const&) = delete; - template + template amount (std::size_t n, std::string const& what); friend @@ -34,7 +34,7 @@ public: operator<< (std::ostream& s, amount const& t); }; -template +template amount::amount (std::size_t n, std::string const& what) : n_ (n) , what_ (what) diff --git a/extras/beast/unit_test/detail/const_container.hpp b/extras/beast/unit_test/detail/const_container.hpp index bf34318f..a4910f01 100644 --- a/extras/beast/unit_test/detail/const_container.hpp +++ b/extras/beast/unit_test/detail/const_container.hpp @@ -16,7 +16,7 @@ namespace detail { The interface allows for limited read only operations. Derived classes provide additional behavior. */ -template +template class const_container { private: diff --git a/extras/beast/unit_test/main.cpp b/extras/beast/unit_test/main.cpp index d461ea83..fa3e9566 100644 --- a/extras/beast/unit_test/main.cpp +++ b/extras/beast/unit_test/main.cpp @@ -33,7 +33,7 @@ static std::string prefix(suite_info const& s) { - if (s.manual()) + if(s.manual()) return "|M| "; return " "; } @@ -121,7 +121,7 @@ int main(int ac, char const* av[]) match_auto(suites)); else failed = r.run_each(global_suites()); - if (failed) + if(failed) return EXIT_FAILURE; return EXIT_SUCCESS; } diff --git a/extras/beast/unit_test/match.hpp b/extras/beast/unit_test/match.hpp index 9137fd0e..20044e2e 100644 --- a/extras/beast/unit_test/match.hpp +++ b/extras/beast/unit_test/match.hpp @@ -45,27 +45,27 @@ private: std::string library_; public: - template + template explicit selector (mode_t mode, std::string const& pattern = ""); - template + template bool operator() (suite_info const& s); }; //------------------------------------------------------------------------------ -template +template selector::selector (mode_t mode, std::string const& pattern) : mode_ (mode) , pat_ (pattern) { - if (mode_ == automatch && pattern.empty()) + if(mode_ == automatch && pattern.empty()) mode_ = all; } -template +template bool selector::operator() (suite_info const& s) { @@ -73,14 +73,14 @@ selector::operator() (suite_info const& s) { case automatch: // suite or full name - if (s.name() == pat_ || s.full_name() == pat_) + if(s.name() == pat_ || s.full_name() == pat_) { mode_ = none; return true; } // check module - if (pat_ == s.module()) + if(pat_ == s.module()) { mode_ = module; library_ = s.library(); @@ -88,7 +88,7 @@ selector::operator() (suite_info const& s) } // check library - if (pat_ == s.library()) + if(pat_ == s.library()) { mode_ = library; return ! s.manual(); diff --git a/extras/beast/unit_test/recorder.hpp b/extras/beast/unit_test/recorder.hpp index e17e9a01..a8738e94 100644 --- a/extras/beast/unit_test/recorder.hpp +++ b/extras/beast/unit_test/recorder.hpp @@ -60,7 +60,7 @@ private: void on_case_end() override { - if (m_case.tests.size() > 0) + if(m_case.tests.size() > 0) m_suite.insert (std::move (m_case)); } diff --git a/extras/beast/unit_test/reporter.hpp b/extras/beast/unit_test/reporter.hpp index 156d4c0f..dafa6b79 100644 --- a/extras/beast/unit_test/reporter.hpp +++ b/extras/beast/unit_test/reporter.hpp @@ -157,7 +157,7 @@ results::add(suite_results const& r) cases += r.cases; failed += r.failed; auto const elapsed = clock_type::now() - r.start; - if (elapsed >= std::chrono::seconds{1}) + if(elapsed >= std::chrono::seconds{1}) { auto const iter = std::lower_bound(top.begin(), top.end(), elapsed, @@ -166,13 +166,13 @@ results::add(suite_results const& r) { return t1.second > t2; }); - if (iter != top.end()) + if(iter != top.end()) { - if (top.size() == max_top) + if(top.size() == max_top) top.resize(top.size() - 1); top.emplace(iter, r.name, elapsed); } - else if (top.size() < max_top) + else if(top.size() < max_top) { top.emplace_back(r.name, elapsed); } @@ -214,7 +214,7 @@ reporter<_>::fmtdur(typename clock_type::duration const& d) { using namespace std::chrono; auto const ms = duration_cast(d); - if (ms < seconds{1}) + if(ms < seconds{1}) return std::to_string(ms.count()) + "ms"; std::stringstream ss; ss << std::fixed << std::setprecision(1) << diff --git a/extras/beast/unit_test/results.hpp b/extras/beast/unit_test/results.hpp index acc17108..ff932865 100644 --- a/extras/beast/unit_test/results.hpp +++ b/extras/beast/unit_test/results.hpp @@ -46,7 +46,7 @@ private: std::size_t failed_; public: - tests_t () + tests_t() : failed_ (0) { } diff --git a/extras/beast/unit_test/runner.hpp b/extras/beast/unit_test/runner.hpp index 03898565..46cca53d 100644 --- a/extras/beast/unit_test/runner.hpp +++ b/extras/beast/unit_test/runner.hpp @@ -68,7 +68,7 @@ public: must be convertible to `suite_info`. @return `true` if any conditions failed. */ - template + template bool run (FwdIter first, FwdIter last); @@ -79,14 +79,14 @@ public: @endcode @return `true` if any conditions failed. */ - template + template bool - run_if (FwdIter first, FwdIter last, Pred pred = Pred{}); + run_if(FwdIter first, FwdIter last, Pred pred = Pred{}); /** Run all suites in a container. @return `true` if any conditions failed. */ - template + template bool run_each (SequenceContainer const& c); @@ -97,9 +97,9 @@ public: @endcode @return `true` if any conditions failed. */ - template + template bool - run_each_if (SequenceContainer const& c, Pred pred = Pred{}); + run_each_if(SequenceContainer const& c, Pred pred = Pred{}); protected: // @@ -159,26 +159,26 @@ private: friend class suite; // Start a new testcase. - template + template void testcase (std::string const& name); - template + template void pass(); - template + template void fail (std::string const& reason); - template + template void log (std::string const& s); }; //------------------------------------------------------------------------------ -template +template bool runner::run (suite_info const& s) { @@ -194,49 +194,49 @@ runner::run (suite_info const& s) return failed_; } -template +template bool runner::run (FwdIter first, FwdIter last) { bool failed (false); - for (;first != last; ++first) + for(;first != last; ++first) failed = run (*first) || failed; return failed; } -template +template bool -runner::run_if (FwdIter first, FwdIter last, Pred pred) +runner::run_if(FwdIter first, FwdIter last, Pred pred) { bool failed (false); - for (;first != last; ++first) - if (pred (*first)) + for(;first != last; ++first) + if(pred (*first)) failed = run (*first) || failed; return failed; } -template +template bool runner::run_each (SequenceContainer const& c) { bool failed (false); - for (auto const& s : c) + for(auto const& s : c) failed = run (s) || failed; return failed; } -template +template bool -runner::run_each_if (SequenceContainer const& c, Pred pred) +runner::run_each_if(SequenceContainer const& c, Pred pred) { bool failed (false); - for (auto const& s : c) - if (pred (s)) + for(auto const& s : c) + if(pred (s)) failed = run (s) || failed; return failed; } -template +template void runner::testcase (std::string const& name) { @@ -245,42 +245,42 @@ runner::testcase (std::string const& name) assert (default_ || ! name.empty()); // Forgot to call pass or fail assert (default_ || cond_); - if (! default_) + if(! default_) on_case_end(); default_ = false; cond_ = false; on_case_begin (name); } -template +template void runner::pass() { std::lock_guard lock(mutex_); - if (default_) + if(default_) testcase (""); on_pass(); cond_ = true; } -template +template void runner::fail (std::string const& reason) { std::lock_guard lock(mutex_); - if (default_) + if(default_) testcase (""); on_fail (reason); failed_ = true; cond_ = true; } -template +template void runner::log (std::string const& s) { std::lock_guard lock(mutex_); - if (default_) + if(default_) testcase (""); on_log (s); } diff --git a/extras/beast/unit_test/suite.hpp b/extras/beast/unit_test/suite.hpp index 025ed4bc..efa30761 100644 --- a/extras/beast/unit_test/suite.hpp +++ b/extras/beast/unit_test/suite.hpp @@ -127,7 +127,7 @@ private: scoped_testcase operator()(abort_t abort); - template + template scoped_testcase operator<<(T const& t); }; @@ -187,11 +187,11 @@ public: /** Expect an exception from f() */ /** @{ */ - template + template bool except (F&& f, String const& reason); - template + template bool except (F&& f) { @@ -201,11 +201,11 @@ public: /** Expect an exception of the given type from f() */ /** @{ */ - template + template bool except (F&& f, String const& reason); - template + template bool except (F&& f) { @@ -215,11 +215,11 @@ public: /** Fail if f() throws */ /** @{ */ - template + template bool unexcept (F&& f, String const& reason); - template + template bool unexcept (F&& f) { @@ -236,12 +236,12 @@ public: // DEPRECATED // @return `true` if the test condition indicates success (a false value) - template + template bool unexpected (Condition shouldBeFalse, String const& reason); - template + template bool unexpected (Condition shouldBeFalse) { @@ -249,12 +249,12 @@ public: } /** Record a successful test condition. */ - template + template void pass(); /** Record a failure. */ - template + template void fail (std::string const& reason = ""); @@ -277,7 +277,7 @@ private: void propagate_abort(); - template + template void run (runner& r); }; @@ -375,7 +375,7 @@ suite::operator()(runner& r) } } -template +template inline bool suite::expect(Condition const& shouldBeTrue, @@ -390,7 +390,7 @@ suite::expect(Condition const& shouldBeTrue, return false; } -template +template bool suite::except (F&& f, String const& reason) { @@ -407,7 +407,7 @@ suite::except (F&& f, String const& reason) return true; } -template +template bool suite::except (F&& f, String const& reason) { @@ -424,7 +424,7 @@ suite::except (F&& f, String const& reason) return true; } -template +template bool suite::unexcept (F&& f, String const& reason) { @@ -441,7 +441,7 @@ suite::unexcept (F&& f, String const& reason) return false; } -template +template inline bool suite::unexpected (Condition shouldBeFalse, @@ -449,14 +449,14 @@ suite::unexpected (Condition shouldBeFalse, { bool const b = static_cast(shouldBeFalse); - if (! b) + if(! b) pass(); else fail (reason); return ! b; } -template +template void suite::pass() { @@ -464,13 +464,13 @@ suite::pass() runner_->pass(); } -template +template void suite::fail (std::string const& reason) { propagate_abort(); runner_->fail (reason); - if (abort_) + if(abort_) { aborted_ = true; throw abort_exception(); @@ -481,11 +481,11 @@ inline void suite::propagate_abort() { - if (abort_ && aborted_) + if(abort_ && aborted_) throw abort_exception(); } -template +template void suite::run (runner& r) { diff --git a/extras/beast/unit_test/suite_list.hpp b/extras/beast/unit_test/suite_list.hpp index d8f62c5d..4dc12e8c 100644 --- a/extras/beast/unit_test/suite_list.hpp +++ b/extras/beast/unit_test/suite_list.hpp @@ -33,7 +33,7 @@ public: The suite must not already exist. */ - template + template void insert( char const* name, @@ -44,7 +44,7 @@ public: //------------------------------------------------------------------------------ -template +template void suite_list::insert( char const* name, diff --git a/extras/beast/unit_test/thread.hpp b/extras/beast/unit_test/thread.hpp index 5e8364b8..316b9e7f 100644 --- a/extras/beast/unit_test/thread.hpp +++ b/extras/beast/unit_test/thread.hpp @@ -44,7 +44,7 @@ public: return *this; } - template + template explicit thread (suite& s, F&& f, Args&&... args) : s_ (&s) diff --git a/include/beast/core/async_completion.hpp b/include/beast/core/async_completion.hpp index 51c2e290..dc39d5ca 100644 --- a/include/beast/core/async_completion.hpp +++ b/include/beast/core/async_completion.hpp @@ -47,7 +47,7 @@ namespace beast { @note See Library Foundations For Asynchronous Operations */ -template +template struct async_completion { /** The type of the final handler called by the asynchronous initiation function. diff --git a/include/beast/core/detail/base64.hpp b/include/beast/core/detail/base64.hpp index 5c65a1e0..801562d5 100644 --- a/include/beast/core/detail/base64.hpp +++ b/include/beast/core/detail/base64.hpp @@ -44,7 +44,7 @@ namespace detail { */ -template +template std::string const& base64_alphabet() { @@ -62,7 +62,7 @@ is_base64(unsigned char c) return (std::isalnum(c) || (c == '+') || (c == '/')); } -template +template std::string base64_encode (std::uint8_t const* data, std::size_t in_len) @@ -112,7 +112,7 @@ base64_encode (std::uint8_t const* data, } -template +template std::string base64_encode (std::string const& s) { @@ -120,7 +120,7 @@ base64_encode (std::string const& s) std::uint8_t const*> (s.data()), s.size()); } -template +template std::string base64_decode(std::string const& data) { diff --git a/include/beast/core/detail/bind_handler.hpp b/include/beast/core/detail/bind_handler.hpp index 849ab619..6b540c28 100644 --- a/include/beast/core/detail/bind_handler.hpp +++ b/include/beast/core/detail/bind_handler.hpp @@ -54,14 +54,14 @@ public: operator()() { invoke(h_, args_, - index_sequence_for ()); + index_sequence_for()); } void operator()() const { invoke(h_, args_, - index_sequence_for ()); + index_sequence_for()); } friend diff --git a/include/beast/core/detail/empty_base_optimization.hpp b/include/beast/core/detail/empty_base_optimization.hpp index 1be8ccde..635f71ff 100644 --- a/include/beast/core/detail/empty_base_optimization.hpp +++ b/include/beast/core/detail/empty_base_optimization.hpp @@ -14,7 +14,7 @@ namespace beast { namespace detail { -template +template struct empty_base_optimization_decide : std::integral_constant ::value @@ -25,7 +25,7 @@ struct empty_base_optimization_decide { }; -template < +template< class T, int UniqueID = 0, bool ShouldDeriveFrom = @@ -57,7 +57,7 @@ public: //------------------------------------------------------------------------------ -template < +template< class T, int UniqueID > diff --git a/include/beast/core/detail/is_call_possible.hpp b/include/beast/core/detail/is_call_possible.hpp index c14dbd34..076c9ce2 100644 --- a/include/beast/core/detail/is_call_possible.hpp +++ b/include/beast/core/detail/is_call_possible.hpp @@ -13,7 +13,7 @@ namespace beast { namespace detail { -template +template auto is_call_possible_test(C&& c, int, A&& ...a) -> decltype(std::is_convertible< @@ -21,7 +21,7 @@ is_call_possible_test(C&& c, int, A&& ...a) std::is_same::value, std::true_type()); -template +template std::false_type is_call_possible_test(C&& c, long, A&& ...a); @@ -30,13 +30,13 @@ is_call_possible_test(C&& c, long, A&& ...a); is_call_possible */ /** @{ */ -template +template struct is_call_possible : std::false_type { }; -template +template struct is_call_possible : decltype(is_call_possible_test( std::declval(), 1, std::declval()...)) diff --git a/include/beast/core/detail/sha1.hpp b/include/beast/core/detail/sha1.hpp index a868568f..4aa83037 100644 --- a/include/beast/core/detail/sha1.hpp +++ b/include/beast/core/detail/sha1.hpp @@ -281,10 +281,10 @@ finish(sha1_context& ctx, void* digest) noexcept ctx.buf[ctx.buflen++] = 0x00; std::uint32_t block[BLOCK_INTS]; sha1::make_block(ctx.buf, block); - if (buflen > BLOCK_BYTES - 8) + if(buflen > BLOCK_BYTES - 8) { sha1::transform(ctx.digest, block); - for (size_t i = 0; i < BLOCK_INTS - 2; i++) + for(size_t i = 0; i < BLOCK_INTS - 2; i++) block[i] = 0; } diff --git a/include/beast/core/detail/stream_concepts.hpp b/include/beast/core/detail/stream_concepts.hpp index 39edcced..b71557f6 100644 --- a/include/beast/core/detail/stream_concepts.hpp +++ b/include/beast/core/detail/stream_concepts.hpp @@ -34,7 +34,7 @@ class has_get_io_service decltype(std::declval().get_io_service()), boost::asio::io_service&>> static R check(int); - template + template static std::false_type check(...); public: using type = decltype(check(0)); diff --git a/include/beast/core/dynabuf_readstream.hpp b/include/beast/core/dynabuf_readstream.hpp index 9e8199db..be7465f4 100644 --- a/include/beast/core/dynabuf_readstream.hpp +++ b/include/beast/core/dynabuf_readstream.hpp @@ -227,7 +227,7 @@ public: /// Write the given data to the stream. Returns the number of bytes written, /// or 0 if an error occurred. - template + template std::size_t write_some(ConstBufferSequence const& buffers, error_code& ec) diff --git a/include/beast/core/handler_alloc.hpp b/include/beast/core/handler_alloc.hpp index cc12eace..50fc0929 100644 --- a/include/beast/core/handler_alloc.hpp +++ b/include/beast/core/handler_alloc.hpp @@ -34,10 +34,10 @@ namespace beast { caller is still responsible for freeing memory. */ #if GENERATING_DOCS -template +template class handler_alloc; #else -template +template class handler_alloc { private: @@ -46,7 +46,7 @@ private: // should produce a compile error if CompletionHandler is not // constructible from H. // - template + template friend class handler_alloc; CompletionHandler h_; diff --git a/include/beast/core/impl/dynabuf_readstream.ipp b/include/beast/core/impl/dynabuf_readstream.ipp index a0fbd9b1..73e75afc 100644 --- a/include/beast/core/impl/dynabuf_readstream.ipp +++ b/include/beast/core/impl/dynabuf_readstream.ipp @@ -85,7 +85,7 @@ public: is_continuation(op->d_->h); } - template + template friend void asio_handler_invoke(Function&& f, read_some_op* op) { diff --git a/include/beast/http/basic_parser_v1.hpp b/include/beast/http/basic_parser_v1.hpp index 871f04cd..555d3f6e 100644 --- a/include/beast/http/basic_parser_v1.hpp +++ b/include/beast/http/basic_parser_v1.hpp @@ -482,7 +482,7 @@ private: std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -501,7 +501,7 @@ private: std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -520,7 +520,7 @@ private: std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -539,7 +539,7 @@ private: std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -557,7 +557,7 @@ private: std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -575,7 +575,7 @@ private: std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -594,7 +594,7 @@ private: std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -613,7 +613,7 @@ private: std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -630,7 +630,7 @@ private: decltype(std::declval().on_headers( std::declval(), std::declval()))>> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -649,7 +649,7 @@ private: std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -667,7 +667,7 @@ private: std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: diff --git a/include/beast/http/detail/chunk_encode.hpp b/include/beast/http/detail/chunk_encode.hpp index db38ee88..62accf16 100644 --- a/include/beast/http/detail/chunk_encode.hpp +++ b/include/beast/http/detail/chunk_encode.hpp @@ -29,7 +29,7 @@ class chunk_encode_text // Storage for the longest hex string we might need, plus delimiters. std::array buf_; - template + template static OutIter to_hex(OutIter last, std::size_t n) diff --git a/include/beast/http/detail/has_content_length.hpp b/include/beast/http/detail/has_content_length.hpp index 6ec167c9..09584a5e 100644 --- a/include/beast/http/detail/has_content_length.hpp +++ b/include/beast/http/detail/has_content_length.hpp @@ -22,7 +22,7 @@ class has_content_length_value decltype(std::declval().content_length()), std::uint64_t>> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: diff --git a/include/beast/http/impl/read.ipp b/include/beast/http/impl/read.ipp index 24b484e3..b2acc0d9 100644 --- a/include/beast/http/impl/read.ipp +++ b/include/beast/http/impl/read.ipp @@ -91,7 +91,7 @@ public: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, parse_op* op) { @@ -277,7 +277,7 @@ public: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, read_op* op) { diff --git a/include/beast/http/impl/write.ipp b/include/beast/http/impl/write.ipp index e06d4ab1..64f7a98d 100644 --- a/include/beast/http/impl/write.ipp +++ b/include/beast/http/impl/write.ipp @@ -262,7 +262,7 @@ public: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, write_op* op) { diff --git a/include/beast/websocket/detail/frame.hpp b/include/beast/websocket/detail/frame.hpp index 7ce5cb77..672d11c1 100644 --- a/include/beast/websocket/detail/frame.hpp +++ b/include/beast/websocket/detail/frame.hpp @@ -136,12 +136,12 @@ write(DynamicBuffer& db, frame_header const& fh) if(fh.rsv3) b[0] |= 0x10; b[1] = fh.mask ? 0x80 : 0x00; - if (fh.len <= 125) + if(fh.len <= 125) { b[1] |= fh.len; n = 2; } - else if (fh.len <= 65535) + else if(fh.len <= 65535) { b[1] |= 126; ::new(&b[2]) big_uint16_buf_t{ diff --git a/include/beast/websocket/detail/utf8_checker.hpp b/include/beast/websocket/detail/utf8_checker.hpp index ea3a15f4..6960819d 100644 --- a/include/beast/websocket/detail/utf8_checker.hpp +++ b/include/beast/websocket/detail/utf8_checker.hpp @@ -131,7 +131,7 @@ utf8_checker_t<_>::write(BufferSequence const& bs) { using boost::asio::buffer_cast; using boost::asio::buffer_size; - for (auto const& b : bs) + for(auto const& b : bs) if(! write(buffer_cast(b), buffer_size(b))) return false; diff --git a/include/beast/websocket/impl/accept_op.ipp b/include/beast/websocket/impl/accept_op.ipp index bc94ac35..38443eb4 100644 --- a/include/beast/websocket/impl/accept_op.ipp +++ b/include/beast/websocket/impl/accept_op.ipp @@ -101,7 +101,7 @@ public: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, accept_op* op) { diff --git a/include/beast/websocket/impl/close_op.ipp b/include/beast/websocket/impl/close_op.ipp index 379b756d..4884a2a1 100644 --- a/include/beast/websocket/impl/close_op.ipp +++ b/include/beast/websocket/impl/close_op.ipp @@ -97,7 +97,7 @@ public: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, close_op* op) { diff --git a/include/beast/websocket/impl/handshake_op.ipp b/include/beast/websocket/impl/handshake_op.ipp index 96afabb9..8443fd9a 100644 --- a/include/beast/websocket/impl/handshake_op.ipp +++ b/include/beast/websocket/impl/handshake_op.ipp @@ -93,7 +93,7 @@ public: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, handshake_op* op) { diff --git a/include/beast/websocket/impl/ping_op.ipp b/include/beast/websocket/impl/ping_op.ipp index 46897896..8fc9936d 100644 --- a/include/beast/websocket/impl/ping_op.ipp +++ b/include/beast/websocket/impl/ping_op.ipp @@ -95,7 +95,7 @@ public: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, ping_op* op) { diff --git a/include/beast/websocket/impl/read_frame_op.ipp b/include/beast/websocket/impl/read_frame_op.ipp index 6102e114..0ba00176 100644 --- a/include/beast/websocket/impl/read_frame_op.ipp +++ b/include/beast/websocket/impl/read_frame_op.ipp @@ -117,7 +117,7 @@ public: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, read_frame_op* op) { @@ -252,7 +252,7 @@ operator()(error_code ec,std::size_t bytes_transferred, bool again) break; } d.state = do_read_fh + 2; - if (n == 0) + if(n == 0) { bytes_transferred = 0; break; diff --git a/include/beast/websocket/impl/read_op.ipp b/include/beast/websocket/impl/read_op.ipp index e00d19d3..35fa3a0c 100644 --- a/include/beast/websocket/impl/read_op.ipp +++ b/include/beast/websocket/impl/read_op.ipp @@ -88,7 +88,7 @@ public: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, read_op* op) { diff --git a/include/beast/websocket/impl/response_op.ipp b/include/beast/websocket/impl/response_op.ipp index e1ed45e1..39af5c7b 100644 --- a/include/beast/websocket/impl/response_op.ipp +++ b/include/beast/websocket/impl/response_op.ipp @@ -93,7 +93,7 @@ public: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, response_op* op) { diff --git a/include/beast/websocket/impl/ssl.ipp b/include/beast/websocket/impl/ssl.ipp index a7cd3259..07570e5c 100644 --- a/include/beast/websocket/impl/ssl.ipp +++ b/include/beast/websocket/impl/ssl.ipp @@ -93,7 +93,7 @@ public: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, teardown_ssl_op* op) diff --git a/include/beast/websocket/impl/teardown.ipp b/include/beast/websocket/impl/teardown.ipp index 1d0389b0..4de5444b 100644 --- a/include/beast/websocket/impl/teardown.ipp +++ b/include/beast/websocket/impl/teardown.ipp @@ -80,7 +80,7 @@ public: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, teardown_tcp_op* op) diff --git a/include/beast/websocket/impl/write_frame_op.ipp b/include/beast/websocket/impl/write_frame_op.ipp index f1b33367..2bc9e74f 100644 --- a/include/beast/websocket/impl/write_frame_op.ipp +++ b/include/beast/websocket/impl/write_frame_op.ipp @@ -134,7 +134,7 @@ public: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, write_frame_op* op) { diff --git a/include/beast/websocket/impl/write_op.ipp b/include/beast/websocket/impl/write_op.ipp index ebffc262..3aa48361 100644 --- a/include/beast/websocket/impl/write_op.ipp +++ b/include/beast/websocket/impl/write_op.ipp @@ -91,7 +91,7 @@ public: return op->d_->cont; } - template + template friend void asio_handler_invoke(Function&& f, write_op* op) { diff --git a/test/core/detail/empty_base_optimization.cpp b/test/core/detail/empty_base_optimization.cpp index 26a64751..8049266a 100644 --- a/test/core/detail/empty_base_optimization.cpp +++ b/test/core/detail/empty_base_optimization.cpp @@ -17,7 +17,7 @@ class empty_base_optimization_test : public beast::unit_test::suite { public: - template + template class test1 : private empty_base_optimization { @@ -32,7 +32,7 @@ public: T const& member() const {return Base::member();} }; - template + template class test2 { void* m_p; @@ -53,34 +53,34 @@ public: static bool - test_one () + test_one() { test1 t1(1); test2 t2(2); static_assert(sizeof(t1) == sizeof(t2), "don't optimize for int"); - if (t1.member() != 1) + if(t1.member() != 1) return false; - if (t2.member() != 2) + if(t2.member() != 2) return false; return true; } static bool - test_two () + test_two() { test1 t1((Empty())); test2 t2((Empty())); static_assert(sizeof(t1) < sizeof(t2), "do optimize for Empty"); - if (t1.member() != true) + if(t1.member() != true) return false; - if (t2.member() != true) + if(t2.member() != true) return false; return true; } void - run () + run() { BEAST_EXPECT(test_one()); BEAST_EXPECT(test_two()); diff --git a/test/http/message_fuzz.hpp b/test/http/message_fuzz.hpp index fd29c393..17420b86 100644 --- a/test/http/message_fuzz.hpp +++ b/test/http/message_fuzz.hpp @@ -30,7 +30,7 @@ escaped_string(boost::string_ref const& s) out.append("\\r"); else if(*p == '\n') out.append("\\n"); - else if (*p == '\t') + else if(*p == '\t') out.append("\\t"); else out.append(p, 1); diff --git a/test/http/nodejs_parser.hpp b/test/http/nodejs_parser.hpp index 4cbf2b57..19c09cd5 100644 --- a/test/http/nodejs_parser.hpp +++ b/test/http/nodejs_parser.hpp @@ -223,7 +223,7 @@ private: template().on_start(), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -253,7 +253,7 @@ private: std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -283,7 +283,7 @@ private: decltype(std::declval().on_headers_complete( std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -314,7 +314,7 @@ private: std::declval(), std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -349,7 +349,7 @@ private: std::declval(), std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); #if 0 using type = decltype(check(0)); @@ -389,7 +389,7 @@ private: std::declval(), std::declval(), std::declval()), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -418,7 +418,7 @@ private: template().on_complete(), std::true_type{})> static R check(int); - template + template static std::false_type check(...); using type = decltype(check(0)); public: @@ -488,7 +488,7 @@ nodejs_basic_parser::write( using boost::asio::buffer_cast; using boost::asio::buffer_size; std::size_t bytes_used = 0; - for (auto const& buffer : buffers) + for(auto const& buffer : buffers) { auto const n = write( buffer_cast(buffer), @@ -609,7 +609,7 @@ template void nodejs_basic_parser::check_header() { - if (! value_.empty()) + if(! value_.empty()) { //detail::trim(value_); call_on_field(field_, value_, diff --git a/test/websocket/detail/utf8_checker.cpp b/test/websocket/detail/utf8_checker.cpp index ebc95b69..14749fda 100644 --- a/test/websocket/detail/utf8_checker.cpp +++ b/test/websocket/detail/utf8_checker.cpp @@ -29,7 +29,7 @@ public: { std::array values; std::uint8_t i = 0; - for (auto& c : values) + for(auto& c : values) c = i++; return values; })(); @@ -39,12 +39,12 @@ public: BEAST_EXPECT(utf8.finish()); // Invalid range 128-193 - for (auto it = std::next(buf.begin(), 128); + for(auto it = std::next(buf.begin(), 128); it != std::next(buf.begin(), 194); ++it) BEAST_EXPECT(! utf8.write(&(*it), 1)); // Invalid range 245-255 - for (auto it = std::next(buf.begin(), 245); + for(auto it = std::next(buf.begin(), 245); it != buf.end(); ++it) BEAST_EXPECT(! utf8.write(&(*it), 1)); } @@ -59,7 +59,7 @@ public: // First byte valid range 194-223 buf[0] = static_cast(i); - for (auto j = 128; j <= 191; ++j) + for(auto j = 128; j <= 191; ++j) { // Second byte valid range 128-191 buf[1] = static_cast(j); @@ -67,14 +67,14 @@ public: BEAST_EXPECT(utf8.finish()); } - for (auto j = 0; j <= 127; ++j) + for(auto j = 0; j <= 127; ++j) { // Second byte invalid range 0-127 buf[1] = static_cast(j); BEAST_EXPECT(! utf8.write(buf, 2)); } - for (auto j = 192; j <= 255; ++j) + for(auto j = 192; j <= 255; ++j) { // Second byte invalid range 192-255 buf[1] = static_cast(j); @@ -88,19 +88,19 @@ public: { utf8_checker utf8; std::uint8_t buf[3]; - for (auto i = 224; i <= 239; ++i) + for(auto i = 224; i <= 239; ++i) { // First byte valid range 224-239 buf[0] = static_cast(i); std::int32_t const b = (i == 224 ? 160 : 128); std::int32_t const e = (i == 237 ? 159 : 191); - for (auto j = b; j <= e; ++j) + for(auto j = b; j <= e; ++j) { // Second byte valid range 128-191 or 160-191 or 128-159 buf[1] = static_cast(j); - for (auto k = 128; k <= 191; ++k) + for(auto k = 128; k <= 191; ++k) { // Third byte valid range 128-191 buf[2] = static_cast(k); @@ -108,14 +108,14 @@ public: BEAST_EXPECT(utf8.finish()); } - for (auto k = 0; k <= 127; ++k) + for(auto k = 0; k <= 127; ++k) { // Third byte invalid range 0-127 buf[2] = static_cast(k); BEAST_EXPECT(! utf8.write(buf, 3)); } - for (auto k = 192; k <= 255; ++k) + for(auto k = 192; k <= 255; ++k) { // Third byte invalid range 192-255 buf[2] = static_cast(k); @@ -123,14 +123,14 @@ public: } } - for (auto j = 0; j < b; ++j) + for(auto j = 0; j < b; ++j) { // Second byte invalid range 0-127 or 0-159 buf[1] = static_cast(j); BEAST_EXPECT(! utf8.write(buf, 3)); } - for (auto j = e + 1; j <= 255; ++j) + for(auto j = e + 1; j <= 255; ++j) { // Second byte invalid range 160-255 or 192-255 buf[1] = static_cast(j); @@ -145,24 +145,24 @@ public: using boost::asio::const_buffers_1; utf8_checker utf8; std::uint8_t buf[4]; - for (auto i = 240; i <= 244; ++i) + for(auto i = 240; i <= 244; ++i) { // First byte valid range 240-244 buf[0] = static_cast(i); std::int32_t const b = (i == 240 ? 144 : 128); std::int32_t const e = (i == 244 ? 143 : 191); - for (auto j = b; j <= e; ++j) + for(auto j = b; j <= e; ++j) { // Second byte valid range 128-191 or 144-191 or 128-143 buf[1] = static_cast(j); - for (auto k = 128; k <= 191; ++k) + for(auto k = 128; k <= 191; ++k) { // Third byte valid range 128-191 buf[2] = static_cast(k); - for (auto n = 128; n <= 191; ++n) + for(auto n = 128; n <= 191; ++n) { // Fourth byte valid range 128-191 buf[3] = static_cast(n); @@ -170,14 +170,14 @@ public: BEAST_EXPECT(utf8.finish()); } - for (auto n = 0; n <= 127; ++n) + for(auto n = 0; n <= 127; ++n) { // Fourth byte invalid range 0-127 buf[3] = static_cast(n); BEAST_EXPECT(! utf8.write(const_buffers_1{buf, 4})); } - for (auto n = 192; n <= 255; ++n) + for(auto n = 192; n <= 255; ++n) { // Fourth byte invalid range 192-255 buf[3] = static_cast(n); @@ -185,14 +185,14 @@ public: } } - for (auto k = 0; k <= 127; ++k) + for(auto k = 0; k <= 127; ++k) { // Third byte invalid range 0-127 buf[2] = static_cast(k); BEAST_EXPECT(! utf8.write(buf, 4)); } - for (auto k = 192; k <= 255; ++k) + for(auto k = 192; k <= 255; ++k) { // Third byte invalid range 192-255 buf[2] = static_cast(k); @@ -200,14 +200,14 @@ public: } } - for (auto j = 0; j < b; ++j) + for(auto j = 0; j < b; ++j) { // Second byte invalid range 0-127 or 0-143 buf[1] = static_cast(j); BEAST_EXPECT(! utf8.write(buf, 3)); } - for (auto j = e + 1; j <= 255; ++j) + for(auto j = e + 1; j <= 255; ++j) { // Second byte invalid range 144-255 or 192-255 buf[1] = static_cast(j);