discovering_modern_cpp icon indicating copy to clipboard operation
discovering_modern_cpp copied to clipboard

my_info.hpp is missing

Open jdmairs opened this issue 8 years ago • 1 comments

c++11/template_type_deduction.cpp includes ../myinfo.hpp which is missing. P109 in the book.

jdmairs avatar May 14 '17 15:05 jdmairs

Well I wrote my own my_info but the code for template_type_deduction does not compile in numerous places. Very frustrating because type deduction rules continue to elude me.

In instantiation of ‘void f3(TPara&) [with TPara = int]’: /home/jmairs/Documents/discovering_modern_cpp/c++11/template_type_deduction.cpp:95:9: required from here /home/jmairs/Documents/discovering_modern_cpp/c++11/template_type_deduction.cpp:25:15: error: value-initialization of reference type ‘int&’ << " == " << my_info<decltype(p)>()
^ /home/jmairs/Documents/discovering_modern_cpp/c++11/template_type_deduction.cpp:55:5: note: in expansion of macro ‘info’ info(TPara, p);

jdmairs avatar May 19 '17 20:05 jdmairs