Boost logo

Boost Users :

From: Marc Viala (mviala_at_[hidden])
Date: 2007-01-02 19:48:15


Hello Joaquin & John,

>
> > So I gave up at that point. Adding your example programs to the
> > same VC7.1 IDE project did compile so I don't think it's a
> > setup issue.
>
> That's fine, your help has been invaluable. It definitely
> looks like a local problem, I hope Marc can provide me with
> more info wrt his particular environment. Thank you very much,

Thanks for your help John.

Before trying to recompile some codes from B.MI/test to crash my
compiler w/ an ICE, I've just played with some compilation options in my
IDE and the results are:

In Debug mode:
        If the C/C++ options "/Zi" & "/Gm" are set: KO -> w/ ICE in
apply_wrap.hpp
        If the C/C++ options "/ZI" & "/Gm" are set: KO -> w/ ICE in
apply_wrap.hpp
        If the C/C++ option "/Gm" is not set and "Zi" or "ZI" is set: OK

In Release mode:
        with or without the "/Gm" option set: OK

Funny... It seems that the /Gm option is quite unstable in debug mode? I
don't know exactly the goal of this option but our project template set
this option by default in this mode.

Joaquin or John, do you know the meaning of this compilation option for
VC7.1? Do you know the recommended options w/ this compiler to use Boost
libraries, more specifically B.MI? For information, up to now, we use
"/ZI" or "/Zi" in conjunction with "/Gm" option with all other Boost
libraries.

Thanks for your help.

The code snipped during my compilation test is the following:

#include <boost/config.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/composite_key.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/key_extractors.hpp>

// STL
#include <string>

using namespace boost::multi_index ;

struct Item {
  const std::string& getCls() const
  { return _cls ; }
  const std::string& getId() const
  { return _id ; }

  std::string _cls ;
  std::string _id ;
  int _i ;
  int _j ;
} ;

void main()
{
  typedef const_mem_fun<
      Item
    , const std::string&
    , &Item::getCls
> key_cls ;
  typedef const_mem_fun<
      Item
    , const std::string&
    , &Item::getId
> key_id ;
  typedef composite_key<Item,key_cls,key_id> ckey_clsid ;
  typedef multi_index_container<
    Item,
    indexed_by<
        ordered_non_unique<key_id>
      , ordered_non_unique<key_cls>
      , ordered_unique<ckey_clsid>
>
> ObjectContainer ;

  ObjectContainer c ;
}


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