Robert Osfield wrote:

HI Gustavo,

On 5/21/06, *Gustavo Wagner* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Robert, I think we really could have a trim() method in OSG's
    Array class. Resizing the vector with v.resize( v.size() ) and
    other methods are not working as expected. This simple method
    inside osg::TemplateArray() would do what we need in a very
    efficient way:

                inline void trim()

                {

                      std::vector<T>( * this ).swap( *this );

                }

    Could you add it, please?


I you want to make submissions then you'll need to supply whole files, and send them to osg-submissions. Have a read through SubmissionsProtocol on the website.

As for the this specific bit of code, I'm kinda suprised.... What does trim mean??? Trim to what???

I think it means making the vector use precisely the amount of memory as there are elements in the vector, i.e. no extra capacity...

Knowing C++ I know what you are trying to do, but the method name doesn't imply this, and the OSG way is to name obscure features withLongNamesSoThatUsersCanWorkOutWhatTheyMeanWithoutHavingToBeingOriginalTheAuthor

Well, you definitely didn't misspell that one, little rusty on the grammar at the end though ;-)
(sorry, couldn't resist)

Could I asking what you actually need this feature? And why just using the underlying std::vector<> isn't sufficient?

Robert.

------------------------------------------------------------------------

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/



--
Paul Melis

VR Specialist,
Center for High-Performance Computing & Visualization,
University of Groningen,
The Netherlands

T: +31 50 363 9298
E: [EMAIL PROTECTED]
W: http://www.rug.nl/rc/hpcv/index

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to