Re: support for STL bitsets?

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Sat, 17 Nov 2007 14:40:57 +0100


Hi Michael,

we don't have a dictionary for bitset; it wouldn't make sense because each template instantiation needs its own dictionary, so we'd have to generate dictionaries for everything between bitset<1> and bitset<42> :-) You could build your own using e.g. this bs12.h as an example:

#include <bitset>
#ifdef __MAKECINT__
#pragma link C++ class bitset<12>;
#endif

and then within ROOT: .L bs12.h+. But I'm not really impressed with the result; CINT fails to call the proper operators (a long standing problem with CINT), so I cannot set nor retrieve the bitset values. To be fixed. I have not tested whether CINT's dictionary is correct for I/O.

Until all of that is fixed, and until we can generate dictionaries for template instances on the fly: why don't you use TBits? <http://root.cern.ch/root/html/TBits> It should do what you need.

Cheers, Axel.

Michael Niegl wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello everyone,
> I have a question concerning the support of STL bitsets in ROOT/CINT. I
> tried using them within a ROOT script but even when I do #include
> <bitset> at the first declaration of a bitset I always get the message
> Error: Symbol bitset is not defined in current scope testbit.C:9:
> so it seems to me that this class is currently simply not supported (I
> have no problem using other STL classes, for example vector). As however
> on the CINT limitations webpage I couldn't find anything really stating
> that they're not supported and the $ROOTSYS/cint/stl directory contains
> header files for bitset that are very much alike to the working STL
> classes I'm a bit unsure whether this is an unsupported feature (if so,
> are there any plans to implement it?) or me doing something wrong.
> I'm using ROOT 5.16/00 on an intel Mac OS X 10.4.10.
>
> Many thanks & cheers,
> Michael
>
> ===========================================
> Michael Niegl, BSc.
>
> University of Applied Sciences Wr. Neustadt
> J. Gutenbergstr. 3, A-2700 Wr. Neustadt, Austria
> Tel.: +43 2622-89084-298 Fax: +43 2622-89084-99
> michael.niegl_at_fhwn.ac.at
> http://www.fhwn.ac.at/
>
> CERN
> PH/UAT/SCT Bat 161-1-020
> CH-1211 Geneva 23, Switzerland
> Tel: +41 22 76 73599 Fax: +41 22 76 77150
> michael.niegl_at_cern.ch
> http://mniegl.web.cern.ch/mniegl/
>
> ===========================================
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (Darwin)
>
> iD8DBQFHPsjej0sQTlOTV0MRAqeiAKDWWvTTJt2uv87gXJ33atzDlVhJ2QCdH61d
> NOSmYGR9qtboduXbiZOjjrk=
> =84z/
> -----END PGP SIGNATURE-----
>
>
Received on Sat Nov 17 2007 - 14:41:11 CET

This archive was generated by hypermail 2.2.0 : Sun Nov 18 2007 - 17:50:01 CET