Commit 06767a9b authored by Qinfan Wu's avatar Qinfan Wu Committed by Facebook Github Bot

Implicit construct sorted_vector_set from std::initializer_list

Summary:
The following thrift file doesn't work:
  typedef set<i32> (cpp.template = "folly::sorted_vector_set") IntSet
  struct Test {
    1: map<i32, IntSet> m = {7: [1, 2]},
  }

The generated file looks like this:
  Test()
      : m(std::initializer_list<
          std::pair<const int32_t, folly::sorted_vector_set<int32_t>>>{
          {7, std::initializer_list<int32_t>{1, 2}}}) {}

Given that `std::set` allows implicit construction from `std::initializer_list`, it's probably okay to make `folly::sorted_vector_set` the same.

Reviewed By: ot

Differential Revision: D3968054

fbshipit-source-id: 978d59a7e545e44d603eeb9671815ac7f2c57342
parent 0e125753
......@@ -216,7 +216,7 @@ public:
insert(first, last);
}
explicit sorted_vector_set(
/* implicit */ sorted_vector_set(
std::initializer_list<value_type> list,
const Compare& comp = Compare(),
const Allocator& alloc = Allocator())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment