The method Menu::expand in Menubackend.C has the following signature:

        /// Expands some special entries of the menu
        /** The entries with the following kind are exanded to a
            sequence of Command MenuItems: Lastfiles, Documents,
            ViewFormats, ExportFormats, UpdateFormats
        */
        void expand(Menu & tomenu, Buffer *) const;
 
It would have been more reasonable to have something like
        Menu const expand(Buffer *) const;

The reason I did not do it is that I was not sure what would happen:
if you create a temporary object in a function, and return it at the
end, is the object copied or do you return it without copy? This can
have some importance if the object is a big vector (think 'table of
contents'). 

So what is the right way to return this kind of big objects?

JMarc

Reply via email to