Project

General

Profile

Bug #57

Bug #53: MSVC10 compilation

MSVC10 - BOOST_SCOPE_EXIT

Added by Anna Maria Bigatti over 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Portability
Target version:
Start date:
07 Dec 2011
Due date:
% Done:

100%

Estimated time:
Spent time:

Description

With Visual Studio there are problems with BOOST_SCOPE_EXIT and this alternative is proposed (thanks to Bruno Simoes):

#define LIGHT_SCOPE_EXIT \
    struct BOOST_PP_CAT ( local_struct_, __LINE__ ) { \
        BOOST_PP_CAT ( ~local_struct_, __LINE__ ) ()

+#define LIGHT_SCOPE_EXIT_END \
    } BOOST_PP_CAT ( local_struct_var_, __LINE__ ); static_cast<void> ( BOOST_PP_CAT ( local_struct_var_, __LINE__ ) );

Is that OK?

History

#1 Updated by Anna Maria Bigatti over 12 years ago

  • Category set to Portability

#2 Updated by Anna Maria Bigatti over 12 years ago

  • % Done changed from 0 to 30

#3 Updated by Anna Maria Bigatti over 12 years ago

  • Subject changed from MSVC10 compilation - BOOST_SCOPE_EXIT to MSVC10 - BOOST_SCOPE_EXIT

#4 Updated by John Abbott about 12 years ago

I wonder why the only reports I can find on the internet about problems with BOOST_SCOPE_EXIT and Visual C++ are ours. Why does no one else have any problems?

Which version of BOOST was Bruno using?

There's something odd going on here. Maybe we are using BOOST_SCOPE_EXIT wrongly?

#5 Updated by John Abbott about 12 years ago

  • Status changed from New to Closed
  • % Done changed from 30 to 100

The problem was that BOOST_SCOPE_EXIT requires at least 1 arg, though this is not entirely evident from their documentation. Someone has already registered a request that BOOST modify their impl to accept no argument.

JAA modified the code by passing (&interpreter) as argument -- not strictly necessary because interpreter is a global [naughty Giovanni].

We have confirmed that the modified code compiles fine on Linux, MacOSX and Windows.

#6 Updated by Anna Maria Bigatti almost 12 years ago

  • Target version set to CoCoA-5.0.2

Also available in: Atom PDF