Boost logo

Boost :

From: Martin (adrianm_at_[hidden])
Date: 2005-03-04 04:37:47


I can't get the singleton to work with VC70.

The error message is

\boost\singleton\creators.hpp(171): error
C2504: 'boost::singleton::detail::longevity_registry<Unused>' : base class
undefined with [ Unused=void ]

My code looks like:

struct manipidx {
  manipidx() : idx(std::ios_base::xalloc()) { }
  int idx;
};

typedef basic_singleton<manipidx> tmanipidx;
int main() {
  std::cout << tmanipidx::pointer()->idx << std::endl;
}

What I'm trying to do is to create a global variable that can be used in all
instanses of a template and at the same time avoid the need for a .cpp file.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk