Prevent erroneous code like vector<fbstring>{{"this", "that"}} from compiling
authorEric Niebler <eniebler@fb.com>
Thu, 20 Oct 2016 22:20:48 +0000 (15:20 -0700)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Thu, 20 Oct 2016 22:23:41 +0000 (15:23 -0700)
commitd8d93ebf4ea53c974cdb9599c3fa3c1f20781e6c
tree0c86929c742d128a8b3f2e18df377313de2c4f2a
parentd2e50930e9d5a304383d1660644c43c77bb2e7e1
Prevent erroneous code like vector<fbstring>{{"this", "that"}} from compiling

Summary: Someone debugged a runtime crash and traced it back to code like: `vector<fbstring>{{"this", "that"}}`. Presumably the user thought they were passing an initializer list of strings to the vector constructor. Instead, they constructed a single fbstring with two char pointers pointing into //different// strings. With the appropriate fbstring constructors, we can flag this as invalid at compile-time.

Reviewed By: yfeldblum

Differential Revision: D3927397

fbshipit-source-id: a5f335073fb55bbb703a23f06874238cbdb5d91a
folly/FBString.h
folly/test/FBStringTest.cpp