Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actuallightxbulb

Posted 31 May 2013 - 01:18 PM

There's a major difference between that example and deducing the argument of the predicate in your first post. The template parameter of greaterThan is deduced from the parameters being passed to it, while you expected that the template parameter of sortDescending to be deduced from the type of the parameter of another function to which the predicate is passed.

Well, the predicate is called anyways - so it actually gets passed arguments from the list from which sort is called.

I mean inside of sort sortDescending is called multiple times like a normal function ( basically sortDescending(*myList.begin(), *(++myList.begin())), sortDescending(*(++myList.begin()), *(++++myList.begin())) etc.) or is it not?

I mean inside of sort you don't have to explicitly sortDescending<T>(*myList.begin(), *(++myList.begin())), sortDescending<T>(*(++myList.begin()), *(++++myList.begin())) etc.

It just seemed strange to me, don't mind it.


#4lightxbulb

Posted 31 May 2013 - 01:09 PM

There's a major difference between that example and deducing the argument of the predicate in your first post. The template parameter of greaterThan is deduced from the parameters being passed to it, while you expected that the template parameter of sortDescending to be deduced from the type of the parameter of another function to which the predicate is passed.

Well, the predicate is called anyways - so it actually gets passed arguments from the list from which sort is called.

I mean inside of sort sortDescending is called multiple times like a normal function ( basically sortDescending(*myList.begin(), *(++myList.begin())), sortDescending(*(++myList.begin()), *(++++myList.begin())) etc.) or is it not?

It just seemed strange to me, don't mind it.


#3lightxbulb

Posted 31 May 2013 - 01:04 PM

There's a major difference between that example and deducing the argument of the predicate in your first post. The template parameter of greaterThan is deduced from the parameters being passed to it, while you expected that the template parameter of sortDescending to be deduced from the type of the parameter of another function to which the predicate is passed.

Well, the predicate is called anyways - so it actually gets passed arguments from the list from which sort is called. It just seemed strange to me, don't mind it.


#2lightxbulb

Posted 31 May 2013 - 01:04 PM

There's a major difference between that example and deducing the argument of the predicate in your first post. The template parameter of greaterThan is deduced from the parameters being passed to it, while you expected that the template parameter of sortDescending to be deduced from the type of the parameter of another function to which the predicate is passed.

Well, the predicate is called anyways - so it actually gets passed arguments from the list from which sort is called. It just seemed strange to me, don't mind it.


#1lightxbulb

Posted 31 May 2013 - 01:04 PM

There's a major difference between that example and deducing the argument of the predicate in your first post. The template parameter of greaterThan is deduced from the parameters being passed to it, while you expected that the template parameter of sortDescending to be deduced from the type of the parameter of another function to which the predicate is passed.

Well, the predicate is called anyway - so it actually gets passed arguments from the list from which sort is called. It just seemed strange to me, don't mind it.


PARTNERS