Boost logo

Boost Users :

Subject: [Boost-users] [scope_exit] 1.57 MSVC C4003 warning
From: Filip Konvièka (filip.konvicka_at_[hidden])
Date: 2014-11-07 05:24:11


Hi,

Any use of BOOST_SCOPE_EXIT in 1.57 seems to emit warning C4003 on MSVC
2012 and 2013:
   warning C4003: not enough actual parameters for macro 'BOOST_PP_EXPAND_I'

Uncomment either line to suppress the warning.

Is BOOST_PP_VARIADICS enabled by mistake for MSVC (especially 2013)?
Should I explicitly set BOOST_PP_VARIADICS=0 for MSVC?

Despite the warning, the code appears to work fine (i.e., the block of
code gets properly called).

Thanks,
Filip

#include <boost/version.hpp>
#if defined(_MSC_VER) && BOOST_VERSION==105700
//#pragma warning(disable:4003)
//#define BOOST_PP_VARIADICS 0
#endif

#include <boost/scope_exit.hpp>

#include <iostream>

int main(int argc, char* argv[]) {
   int x=0;
   BOOST_SCOPE_EXIT((x)) {
     std::cout << "here " << x << std::endl;
   } BOOST_SCOPE_EXIT_END
   return 0;
}


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net