diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e3f0d32..6fef056a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Version 227: + +* Fix decorator for certain sizes + +-------------------------------------------------------------------------------- + Version 226: * Support -fno-exceptions diff --git a/include/boost/beast/websocket/detail/decorator.hpp b/include/boost/beast/websocket/detail/decorator.hpp index 1051cda0..3c28cd4b 100644 --- a/include/boost/beast/websocket/detail/decorator.hpp +++ b/include/boost/beast/websocket/detail/decorator.hpp @@ -223,7 +223,7 @@ public: decorator(F&& f) : base_(construct(std::forward(f), std::integral_constant{})) + sizeof(F) <= Bytes>{})) { } diff --git a/test/beast/websocket/_detail_decorator.cpp b/test/beast/websocket/_detail_decorator.cpp index cf505d23..bb37339c 100644 --- a/test/beast/websocket/_detail_decorator.cpp +++ b/test/beast/websocket/_detail_decorator.cpp @@ -86,6 +86,14 @@ public: char buf[2048]; }; + struct goldi // just right + { + std::array a; + void operator()(request_type &) const + { + } + }; + void dec_req(request_type&) { @@ -121,6 +129,10 @@ public: decorator d3; d3 = std::move(d2); } + + { + decorator d{goldi{}}; + } } void