• Giuseppe Ottaviano's avatar
    Deprecate dynamic::dynamic(std::initializer_list<dynamic>) · 07dc3ce5
    Giuseppe Ottaviano authored
    Summary:After DR95 the single braces dispatch to the copy constructor
    (http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1467),
    so it is not possible anymore to initialize a singleton dynamic array
    using the braces syntax. The initializer list constructor already had
    a special case for empty lists, which unconditionally called the
    default constructor if defined.
    
    This diff deprecates the braces syntax and defines the following alternative:
    ```
    dynamic empty = dynamic::array;
    dynamic a = dynamic::array(1, 2, "foo");
    ```
    
    Reviewed By: luciang, yfeldblum
    
    Differential Revision: D3013423
    
    fb-gh-sync-id: a0cf09dfd96e9806044f7c3bf3592c637a9bc932
    shipit-source-id: a0cf09dfd96e9806044f7c3bf3592c637a9bc932
    07dc3ce5
DynamicTest.cpp 13.9 KB