|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2002-08-01 07:44:17
From: "Terje Slettebø" <tslettebo_at_[hidden]>
> Having looked at mpl::vector, and its docs, it appears that it may be
> possible to get O(1) access to elements, if the compiler supports typeof.
I don't see why typeof should be needed for O(1) access. All you need is a
specialization of at<> for each N up to the maximum size of vector. Of
course, you can use that trick for type lists as well. In fact, I did that
in one place in Boost.Python in order to speed it up on some old compilers,
with the old MPL codebase.
-Dave
-----------------------------------------------------------
David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk