]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/beast/http/impl/parser.ipp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / beast / http / impl / parser.ipp
CommitLineData
b32b8144
FG
1//
2// Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
3//
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)
6//
7// Official repository: https://github.com/boostorg/beast
8//
9
10#ifndef BOOST_BEAST_HTTP_IMPL_PARSER_IPP
11#define BOOST_BEAST_HTTP_IMPL_PARSER_IPP
12
13#include <boost/throw_exception.hpp>
14#include <stdexcept>
15
16namespace boost {
17namespace beast {
18namespace http {
19
20template<bool isRequest, class Body, class Allocator>
21parser<isRequest, Body, Allocator>::
22parser()
23 : wr_(m_)
24{
25}
26
27template<bool isRequest, class Body, class Allocator>
28template<class Arg1, class... ArgN, class>
29parser<isRequest, Body, Allocator>::
30parser(Arg1&& arg1, ArgN&&... argn)
31 : m_(std::forward<Arg1>(arg1),
32 std::forward<ArgN>(argn)...)
33 , wr_(m_)
34{
35 m_.clear();
36}
37
38template<bool isRequest, class Body, class Allocator>
39template<class OtherBody, class... Args, class>
40parser<isRequest, Body, Allocator>::
41parser(parser<isRequest, OtherBody, Allocator>&& other,
42 Args&&... args)
43 : base_type(std::move(other))
44 , m_(other.release(), std::forward<Args>(args)...)
45 , wr_(m_)
46{
47 if(other.rd_inited_)
48 BOOST_THROW_EXCEPTION(std::invalid_argument{
49 "moved-from parser has a body"});
50}
51
52} // http
53} // beast
54} // boost
55
56#endif