1 | #undef NDEBUG
|
---|
2 |
|
---|
3 | #include <boost/log/attributes/attribute_set.hpp>
|
---|
4 | #include <boost/log/attributes/constant.hpp>
|
---|
5 |
|
---|
6 | int main()
|
---|
7 | {
|
---|
8 | boost::log::attribute_set set;
|
---|
9 |
|
---|
10 | for (auto ch='A'; ch <= 'z'; ++ch)
|
---|
11 | {
|
---|
12 | auto const key(std::string("key") + ch);
|
---|
13 | auto const res(set.insert(key, boost::log::attributes::make_constant(5)));
|
---|
14 | assert(res.second); // insertion succeeded
|
---|
15 | assert(set.find(res.first->first) != set.end()); // and so did find
|
---|
16 | for (auto const item : set)
|
---|
17 | {
|
---|
18 | // But this starts to fail once every bucket in the set has an item.
|
---|
19 | assert(set.find(item.first) != set.end());
|
---|
20 | }
|
---|
21 | }
|
---|
22 | return 0;
|
---|
23 | }
|
---|