C++ Brain Teasers by Anders Schau Knatten

C++ Brain Teasers by Anders Schau Knatten

Author:Anders Schau Knatten
Language: eng
Format: epub
Tags: Pragmatic Bookshelf
Publisher: Pragmatic Bookshelf


The deduction rules for auto are based on the rules for template argument deduction. So now that you know these template argument deduction rules, you also know the corresponding auto deduction rules!

​ ​auto​ t1 = nonConstInt; ​// non-const object​

​ ​auto​ t2 = constInt; ​// non-const object​

​ ​auto​ &t3 = nonConstInt; ​// reference to non-const object​

​ ​auto​ &t4 = constInt; ​// reference to const object​

Further Reading

Template Argument Deduction

https://en.cppreference.com/w/cpp/language/template_argument_deduction



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.