Boost logo

Boost :

From: Dirk Gerrits (dirk_at_[hidden])
Date: 2002-10-23 01:11:03


David B. Held wrote:

> Dirk Gerrits wrote:
>
> > [...]
> > How exactly did multi-threading come into play? Or did you refer to
> > some other meaning of 'threaded'? :)
>
>
> Yes. In tree terminology, "threading" means to use leaf child pointers
> to create a "fast" inorder traversal. I was just abusing this term
> somewhat to refer to tree pointers in general (imagine two trees over
> the same set of nodes, where each node occupies a different location in
> each tree...the "branches" of the trees are like "threads" that are
> "interwoven").

Ah, ok.

>
> > [...]
> > > Possibly a syntax like this could be possible:
> > >
> > > nmap map;
> > > map.key<1>["joe"] = employee_record;
> > > map.key<2>["123-45-6789"] = employee2;
> > > employee_id = map[35]; // defaults to .key<0>

[snip]

>
> Hmm...after playing around with it, my preferred syntax doesn't seem
> possible. However, this looks promising, and can probably be
> implemented with the preprocessor library:
>
> template
> class map
> {
> public:
> template
> class key
> {
> public:
> int operator[](T) { return 5; }
> };
> key key0;
> key key1;
> };
>
> int main()
> {
> map m;
> m.key0[3];
> }

I think I'd prefer the other notation because it allows you to use
compile-time constants as indices. Perhaps you could offer both a
preferred syntax and a compatible syntax in the spirit of Boost.Function
and Boost.Signals?

>
> > In any case, the library suggestions in this thread seem promising.
>
>
> Oh, so now we're back to single threading? ;)

LOL, I commented about your 'threads' and didn't even notice my own. :)

Regards,
Dirk Gerrits


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