Boost logo

Boost :

From: Dylan Cuthbert (dylan_at_[hidden])
Date: 2002-08-12 03:11:30

Hi there,

Sounds cool, just one question, why do you need .vector()[3], why not return
a template wrapper class for the variable that "operator TYPE"s down to
whatever type it is, and at the same time has an operator[] that
automatically casts the type and applies [] to it.


or is that simple getting *too* obscure now ;) seems a fairly elegant way
to mix integers with strings to me in the variable specification, think I'll
implement it in my version tonight ;-)

I also have the "execute" wrappers that parse input files etc. and yes, this
kind of system is really really useful.


Q-Games, Dylan Cuthbert.
P2P internet radio -

"Geoff Leyland" <geoff.leyland_at_[hidden]> wrote in message
On Lundi, août 12, 2002, at 07:52 , "Dylan Cuthbert" <dylan_at_[hidden]>

> We have a similar system implemented here, using map<string,any> as the
> container for the variables and supporting nested structures in the
> same way
> you are.

Oh hey,

I'd kind of shut up about that, because no-one seemed that interested,
*but*, if anyone is...
I've got the same thing as you, with a few differences, and maybe a few
additions (or maybe you just didn't mention them).

Firstly, it doesn't use any (it should, I know, but I'm waiting for the
next version of boost to see what the new version of any is like).

Then, it also understands array syntax, so there's no only a
whatever_map, also a whatever_vector, and you can go

(which is the same as a["one.two"].vector()[3]["four"])

And finally, I tacked on a little lexer/parser so that it reads text
files - this is really cool. Unfortunately, since there isn't a parser
library in Boost (is Spirit coming?) and I'd normally do it in antlr,
which has quite a big run-time, I wrote it by hand, which was probably a
bit silly.

Anyway, I find it incredibly useful - especially now that the parser
(and a few other handy things like merging maps is done). If boost is
interested I'd be very happy to do what it takes to get it together.

The directions that need to be taken on my code are :
documenting (is doxygen ok?)
exception safety (though, given that that's been talked about for
variant at the moment, maybe I should wait. Is there a type_trait
that'll tell me about trivial constructors and destructors?)
getting other people's input
using any (or ideally, parameterising the contained type)
writing the parser with a more sensible tool
arranging nice interfaces to scripting languages (MATLAB, python, I
don't know what else)

If anyone wants a look I could put it somewhere accessible (or is it ok
to put it on the files area of the mailing list?). I certainly wouldn't
recommend it as an implementation at the moment, but it is a kind of
"working demonstration" of the functionality that I think would be nice.

No takers for Sobol sequences? Anyone want an explanation of what they
might be good for?


Geoff Leyland, Village Idiot
Laboratoire d'energetique industrielle
LENI-DGM-EPFL, CH-1015, Lausanne, Switzerland
Phone: +41 (21) 693 3505, Fax: +41 (21) 693 35 02
Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at