Serving the Quantitative Finance Community

 
User avatar
Cuchulainn
Topic Author
Posts: 20256
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

C++ 14

July 22nd, 2015, 4:00 pm

Nice to see type traits being replaced by more savvy alias templates.Type traits were so unintuitive. A lot of code rewrite for library builders methinks. ?Item # 9 say typedef is sooo C++98.
Last edited by Cuchulainn on July 22nd, 2015, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Topic Author
Posts: 20256
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

C++ 14

July 29th, 2015, 2:01 pm

 
User avatar
Cuchulainn
Topic Author
Posts: 20256
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

C++ 14

July 29th, 2015, 4:36 pm

Lambda names cannot be overloaded.
 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

C++ 14

July 29th, 2015, 5:42 pm

QuoteOriginally posted by: CuchulainnLambda names cannot be overloaded.But English names can be overloaded and your statement may be English....????
 
User avatar
Cuchulainn
Topic Author
Posts: 20256
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

C++ 14

July 30th, 2015, 8:59 am

QuoteOriginally posted by: Traden4AlphaQuoteOriginally posted by: CuchulainnLambda names cannot be overloaded.But English names can be overloaded and your statement may be English....???? Is it a bug or an (un)documented feature?
Last edited by Cuchulainn on July 29th, 2015, 10:00 pm, edited 1 time in total.
 
User avatar
Polter
Posts: 1
Joined: April 29th, 2008, 4:55 pm

C++ 14

July 30th, 2015, 11:21 am

Same rules as always, cannot re-declare the variable.It would be equivalent todouble x = 0.0;and thenint x = 0;However, perhaps you can get some of what you want with variadic generic lambdas:http://stackoverflow.com/questions/2588 ... lambdaNote how `list` is just a single (variadic generic) lambda but can still take a varying number of differently typed arguments:auto three = length(list(1, '2', "3"));
Last edited by Polter on July 29th, 2015, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Topic Author
Posts: 20256
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

C++ 14

July 31st, 2015, 8:59 am

QuoteOriginally posted by: PolterSame rules as always, cannot re-declare the variable.It would be equivalent todouble x = 0.0;and thenint x = 0;However, perhaps you can get some of what you want with variadic generic lambdas:http://stackoverflow.com/questions/2588 ... lambdaNote how `list` is just a single (variadic generic) lambda but can still take a varying number of differently typed arguments:auto three = length(list(1, '2', "3"));I see. I realize now that the lambda creates a run-time closure object and the parameters probably are part of the function call operator signature. Then only one class name will be generated by the compiler is my hunch.A lambda walks and talks like a function but it is not a function in the usual sense.
 
User avatar
Cuchulainn
Topic Author
Posts: 20256
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

C++ 14

July 31st, 2015, 9:44 am

I think some of the features in C+11 can be done more easily in C++14 (e.g. typename/typedef template wrappers replaced by alias templates).