2 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // Official repository: https://github.com/boostorg/beast
10 #ifndef BOOST_BEAST_HTTP_IMPL_PARSER_HPP
11 #define BOOST_BEAST_HTTP_IMPL_PARSER_HPP
13 #include <boost/throw_exception.hpp>
20 template<bool isRequest, class Body, class Allocator>
21 parser<isRequest, Body, Allocator>::
23 : rd_(m_.base(), m_.body())
27 template<bool isRequest, class Body, class Allocator>
28 template<class Arg1, class... ArgN, class>
29 parser<isRequest, Body, Allocator>::
30 parser(Arg1&& arg1, ArgN&&... argn)
32 std::forward<Arg1>(arg1),
33 std::forward<ArgN>(argn)...)
34 , rd_(m_.base(), m_.body())
39 template<bool isRequest, class Body, class Allocator>
40 template<class OtherBody, class... Args, class>
41 parser<isRequest, Body, Allocator>::
43 parser<isRequest, OtherBody, Allocator>&& other,
45 : basic_parser<isRequest>(std::move(other))
46 , m_(other.release(), std::forward<Args>(args)...)
47 , rd_(m_.base(), m_.body())
50 BOOST_THROW_EXCEPTION(std::invalid_argument{
51 "moved-from parser has a body"});