Skip to content

msvc: BOOST_PP_VARIADIC_SIZE broken for size larger than 64 #42

@timblechmann

Description

@timblechmann
#define BOOST_PP_LIMIT_VARIADIC 256

#include <boost/preprocessor/variadic/size.hpp>

#include <cstddef>

#define VAR_DATA a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, b, b, b, b, b

constexpr size_t sz = BOOST_PP_VARIADIC_SIZE(VAR_DATA);

static_assert(sz == 65);

gives:


<source>(9): error C2065: 'b': undeclared identifier
<source>(9): error C2131: expression did not evaluate to a constant
<source>(9): note: a non-constant (sub-)expression was encountered
<source>(11): error C2131: expression did not evaluate to a constant
<source>(9): note: a non-constant (sub-)expression was encountered

compare: https://godbolt.org/z/bfoETMnad

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions