Boost logo

Boost :

Subject: [boost] [config] Macro for initializer-list literals?
From: Peter Dimov (lists_at_[hidden])
Date: 2014-08-09 05:23:34

We have BOOST_NO_CXX11_HDR_INITIALIZER_LIST, which tells us whether we can
#include <initializer_list> and use std::initializer_list; we also have
BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX, which tells us whether we can
use X{ 1, 2 }, or X x{ 1, 2}.

But we don't have a macro that tells us whether this:

struct X
    int a, b;

void f( X x )

int main()
    f( { 1, 2 } );

is supported.

This is a problem for

because the test is guarded by BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX:

and this macro is not set for Intel 13.1 in C++0x mode. Presumably the
compiler allows braced initialization, but not braced literals.

Boost list run by bdawes at, gregod at, cpdaniel at, john at