Protect basic_fields special members (API Change)

This commit is contained in:
Vinnie Falco
2017-06-06 12:03:30 -07:00
parent 3eb1d1025b
commit ace99bd6c0
3 changed files with 22 additions and 12 deletions

View File

@@ -10,6 +10,7 @@ API Changes:
* Remove header_parser
* Add verb to on_request for parsers
* Refactor prepare
* Protect basic_fields special members
--------------------------------------------------------------------------------

View File

@@ -71,15 +71,11 @@ public:
off_t len;
};
public:
/// The type of allocator used.
using allocator_type = Allocator;
/// A constant iterator to the field sequence.
class const_iterator;
/// A constant iterator to the field sequence.
using iterator = const_iterator;
protected:
//
// These are for `header`
//
friend class fields_test;
/// Destructor
~basic_fields();
@@ -152,6 +148,16 @@ public:
#endif
basic_fields& operator=(basic_fields<OtherAlloc> const&);
public:
/// The type of allocator used.
using allocator_type = Allocator;
/// A constant iterator to the field sequence.
class const_iterator;
/// A constant iterator to the field sequence.
using iterator = const_iterator;
/// Return a copy of the allocator associated with the container.
allocator_type
get_allocator() const
@@ -304,7 +310,10 @@ public:
swap(basic_fields<Alloc>& lhs, basic_fields<Alloc>& rhs);
protected:
// for header
//
// for `header
//
string_view method_impl() const;
string_view target_impl() const;
string_view reason_impl() const;

View File

@@ -114,14 +114,14 @@ public:
}
{
fields h;
header<true, fields> h;
h.insert("User-Agent", "test");
message<true, one_arg_body, fields> m{Arg1{}, h};
BEAST_EXPECT(h["User-Agent"] == "test");
BEAST_EXPECT(m["User-Agent"] == "test");
}
{
fields h;
header<true, fields> h;
h.insert("User-Agent", "test");
message<true, one_arg_body, fields> m{Arg1{}, std::move(h)};
BEAST_EXPECT(! h.exists("User-Agent"));