All you do is place the criteria function in the Function pointer. --- On Tue, 8/11/09, [email protected] <[email protected]> wrote:
From: [email protected] <[email protected]> Subject: Re: [c-prog] how to Sort boost collection class using multi sorting options/criteria To: [email protected] Date: Tuesday, August 11, 2009, 12:50 AM Benjamin: How this will work for sorting by more then one criteria. Benjamin Scott-2 wrote: > > I'd recommend a Function Pointer as follows: > > void Sort(int Length, Nodes *ToSort(), Node **Decider(Node one,Node Two)) > {}; > The way this is supposed to work: Length is an Integer specifing how many > nodes are in the Array, ToSort in a pointer to an array of DataType called > Node, Decider is a pointer to a function that returns the value of > Datatype called Node and accepts Two varibles that are of the Datatype > called node. > > Sizeof may work after you save the an array varible. Decider is called to > return either the "Smaller" or the "Larger" depending on the programming > of this sort procedure. > > > NOTE: Please excuse any Syntax errors: It's been a while since the > last time I coded in C. > > Prehaps this will help!!! > > --- On Mon, 8/10/09, ch.a...@gmail. com <ch.a...@gmail. com> wrote: > > From: ch.a...@gmail. com <ch.a...@gmail. com> > Subject: [c-prog] how to Sort boost collection class using multi sorting > options/criteria > To: c-p...@yahoogroups. com > Date: Monday, August 10, 2009, 5:10 AM > > > > > > > > > > > > > > > Hi I am using boost collection class. > > > > I did sorting e.g apply a quick/bubble sort algo , but i want to do > sorting > > using multiple criteria. how we can implement using boost. > > Do boost have any classes or functions through which I can easily sort > the > > data using multiple options? > > > > Thanks. > > Asad > > -- > > View this message in context: http://www.nabble. com/how-to- Sort-boost- > collection- class-using- multi-sorting- options-criteria -tp24897279p2489 > 7279.html > > Sent from the C-prog mailing list archive at Nabble.com. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > [Non-text portions of this message have been removed] > > > -- View this message in context: http://www.nabble. com/how-to- Sort-boost- collection- class-using- multi-sorting- options-criteria -tp24897279p2491 2043.html Sent from the C-prog mailing list archive at Nabble.com. [Non-text portions of this message have been removed]
