From 06767a9baba5f24d42884a564c4214dad6d03253 Mon Sep 17 00:00:00 2001 From: Qinfan Wu Date: Tue, 4 Oct 2016 13:58:10 -0700 Subject: [PATCH] Implicit construct sorted_vector_set from std::initializer_list Summary: The following thrift file doesn't work: typedef set (cpp.template = "folly::sorted_vector_set") IntSet struct Test { 1: map m = {7: [1, 2]}, } The generated file looks like this: Test() : m(std::initializer_list< std::pair>>{ {7, std::initializer_list{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 --- folly/sorted_vector_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/folly/sorted_vector_types.h b/folly/sorted_vector_types.h index d6038869..6809dde7 100644 --- a/folly/sorted_vector_types.h +++ b/folly/sorted_vector_types.h @@ -216,7 +216,7 @@ public: insert(first, last); } - explicit sorted_vector_set( + /* implicit */ sorted_vector_set( std::initializer_list list, const Compare& comp = Compare(), const Allocator& alloc = Allocator()) -- 2.34.1