├── 9781430261933.jpg ├── LICENSE.txt ├── README.md ├── contributing.md └── exploring-cpp-2e ├── chapter01 └── list0102.cpp ├── chapter02 ├── list0201.cpp └── list0203.cpp ├── chapter03 ├── list0301.cpp ├── list0302.cpp ├── list0303.cpp ├── list0304.cpp └── list0305.cpp ├── chapter04 ├── list0401.cpp ├── list0402.cpp ├── list0403.cpp ├── list0404.cpp ├── list0405.cpp └── list0406.cpp ├── chapter05 ├── list0501.cpp ├── list0502.cpp ├── list0503.cpp └── list0504.cpp ├── chapter06 └── list0601.cpp ├── chapter07 ├── list0701.cpp ├── list0702.cpp ├── list0703.cpp ├── list0704.cpp └── list0705.cpp ├── chapter08 ├── list0801.cpp ├── list0802.cpp ├── list0803.cpp ├── list0804.cpp ├── list0805.cpp ├── list0806.cpp └── list0807.cpp ├── chapter09 └── list0901.cpp ├── chapter10 ├── list1001.cpp ├── list1002.cpp ├── list1003.cpp ├── list1004.cpp └── list1005.cpp ├── chapter11 ├── list1101.cpp ├── list1102.cpp ├── list1103.cpp ├── list1104.cpp └── list1105.cpp ├── chapter12 ├── list1201.cpp ├── list1202.cpp ├── list1203.cpp ├── list1204.cpp ├── list1205.cpp └── list1206.cpp ├── chapter13 ├── list1301.cpp ├── list1302.cpp ├── list1303.cpp └── list1304.cpp ├── chapter14 ├── list1401.cpp ├── list1401.txt ├── list1402.cpp ├── list1402.in └── list1403.cpp ├── chapter15 ├── explore15.txt ├── list1501.cpp ├── list1502.cpp ├── list1503.cpp └── list1504.cpp ├── chapter16 └── list1601.cpp ├── chapter17 ├── list1701.cpp ├── list1702.cpp └── list1703.cpp ├── chapter18 ├── list1801.cpp ├── list1802.cpp ├── list1803.cpp └── list1804.cpp ├── chapter19 └── list1901.cpp ├── chapter20 ├── list2001.cpp ├── list2002.cpp └── list2003.cpp ├── chapter21 ├── list2101.cpp └── list2102.cpp ├── chapter22 ├── list2201.cpp ├── list2202.cpp ├── list2203.cpp ├── list2204.cpp └── list2205.cpp ├── chapter23 ├── list2301.cpp ├── list2302.cpp ├── list2303.cpp ├── list2304.cpp ├── list2305.cpp └── list2306.cpp ├── chapter24 ├── list2401.cpp └── list2402.cpp ├── chapter25 ├── list2501.cpp ├── list2502.cpp ├── list2503.cpp ├── list2504.cpp ├── list2505.cpp └── list2506.cpp ├── chapter26 ├── list2601.cpp ├── list2602.cpp └── list2603.cpp ├── chapter27 └── list2701.cpp ├── chapter28 ├── Doxyfile ├── Makefile ├── bmi.cpp ├── bmi.in ├── html │ ├── bc_s.png │ ├── bdwn.png │ ├── bmi_8cpp.html │ ├── bmi_8cpp_source.html │ ├── closed.png │ ├── dir_06b735e75e1729acd777fffa105eeb3c.html │ ├── dir_25d354bf040ec750e0120f0982f53261.html │ ├── dir_3ace0cce4a09856c37b63fc59133c1d5.html │ ├── dir_44a7aa12b37f765906d213dbffd75e5b.html │ ├── dir_5961eda7cb40d774174e8610beb281e0.html │ ├── dir_c5ea0433b6dfcb1f127a5cb7025cefc4.html │ ├── dir_d853d10112248e27eccab5e513c2663b.html │ ├── doxygen.css │ ├── doxygen.png │ ├── dynsections.js │ ├── files.html │ ├── ftv2blank.png │ ├── ftv2cl.png │ ├── ftv2doc.png │ ├── ftv2folderclosed.png │ ├── ftv2folderopen.png │ ├── ftv2lastnode.png │ ├── ftv2link.png │ ├── ftv2mlastnode.png │ ├── ftv2mnode.png │ ├── ftv2mo.png │ ├── ftv2node.png │ ├── ftv2ns.png │ ├── ftv2plastnode.png │ ├── ftv2pnode.png │ ├── ftv2splitbar.png │ ├── ftv2vertline.png │ ├── globals.html │ ├── globals_func.html │ ├── index.html │ ├── jquery.js │ ├── nav_f.png │ ├── nav_g.png │ ├── nav_h.png │ ├── open.png │ ├── sync_off.png │ ├── sync_on.png │ ├── tab_a.png │ ├── tab_b.png │ ├── tab_h.png │ ├── tab_s.png │ └── tabs.css └── list2801.txt ├── chapter29 ├── list2901.cpp ├── list2902.cpp ├── list2903.cpp ├── list2904.cpp ├── list2905.cpp └── list2906.cpp ├── chapter30 ├── list3001.cpp ├── list3002.cpp ├── list3003.cpp ├── list3004.cpp ├── list3005.cpp ├── list3006.cpp ├── list3007.cpp ├── list3008.cpp ├── list3009.cpp ├── list3010.cpp ├── list3011.cpp ├── list3012.cpp └── test.hpp ├── chapter31 ├── list3101.cpp ├── list3102.cpp └── list3103.cpp ├── chapter32 ├── list3201.cpp ├── list3202.cpp ├── list3203.cpp ├── list3204.cpp └── list3205.cpp ├── chapter33 ├── list3301.cpp ├── list3302.cpp ├── list3303.cpp ├── list3304.cpp ├── list3305.cpp └── list3306.cpp ├── chapter34 ├── list3401.cpp ├── list3402.cpp ├── list3403.cpp └── list3404.cpp ├── chapter35 ├── list3501.cpp ├── list3502.cpp ├── list3503.cpp └── list3504.cpp ├── chapter37 ├── list3701.cpp ├── list3702.cpp ├── list3703.cpp ├── list3704.cpp └── list3705.cpp ├── chapter38 ├── list3801.cpp ├── list3802.cpp ├── list3803.cpp ├── list3804.cpp ├── list3805.cpp ├── list3806.cpp └── list3807.cpp ├── chapter39 ├── list3901.cpp ├── list3902.cpp ├── list3903.cpp └── list3904.cpp ├── chapter40 ├── list4001.cpp ├── list4002.cpp ├── list4003.cpp ├── list4004.cpp ├── list4005.cpp ├── list4006.cpp ├── list4007.cpp ├── list4008.cpp └── list4009.cpp ├── chapter41 ├── generate_id.hpp ├── list4101.cpp ├── list4102.cpp ├── list4103.cpp ├── list4104.cpp ├── list4105.hpp ├── list4106.cpp ├── list4107.cpp ├── list4108.cpp ├── list4109.hpp ├── list4110.cpp ├── list4111.hpp ├── list4112.cpp ├── list4113.hpp ├── math.hpp ├── point.hpp ├── pragma_once.hpp └── vital_stats.hpp ├── chapter42 ├── generate_id.hpp ├── library.hpp ├── list4201.hpp ├── list4202.cpp ├── list4203.cpp ├── list4204.cpp ├── list4205.cpp ├── list4206.hpp └── sequence.hpp ├── chapter43 ├── data.hpp ├── intrange.hpp ├── list4301.cpp ├── list4302.hpp ├── list4303.hpp ├── list4304.cpp ├── list4305.hpp ├── list4306.cpp ├── list4307.cpp ├── list4308.cpp ├── list4309.cpp ├── list4310.cpp ├── list4311.cpp ├── list4312.cpp ├── list4313.cpp ├── randomint.hpp └── sequence.hpp ├── chapter44 ├── data.hpp ├── list4401.cpp ├── list4402.cpp ├── list4403.cpp ├── list4404.cpp ├── list4405.cpp ├── list4406.cpp └── sequence.hpp ├── chapter45 ├── list4501.cpp ├── list4502.cpp ├── list4503.cpp ├── list4504.cpp ├── list4505.cpp ├── list4506.hpp ├── list4507.cpp ├── list4508.cpp └── rational.hpp ├── chapter46 ├── list4601.cpp ├── list4602.cpp ├── list4603.cpp ├── list4604.cpp ├── list4605.cpp ├── list4606.cpp ├── list4607.cpp ├── list4608.cpp ├── list4609.cpp ├── list4610.hpp ├── rational.cpp └── rational.hpp ├── chapter47 ├── Doxyfile ├── Makefile ├── fixed.cpp ├── fixed.hpp ├── html │ ├── annotated.html │ ├── bc_s.png │ ├── bdwn.png │ ├── classes.html │ ├── classfixed-members.html │ ├── classfixed.html │ ├── classioflags-members.html │ ├── classioflags.html │ ├── closed.png │ ├── doxygen.css │ ├── doxygen.png │ ├── dynsections.js │ ├── files.html │ ├── fixed_8cpp_source.html │ ├── fixed_8hpp.html │ ├── fixed_8hpp_source.html │ ├── ftv2blank.png │ ├── ftv2cl.png │ ├── ftv2doc.png │ ├── ftv2folderclosed.png │ ├── ftv2folderopen.png │ ├── ftv2lastnode.png │ ├── ftv2link.png │ ├── ftv2mlastnode.png │ ├── ftv2mnode.png │ ├── ftv2mo.png │ ├── ftv2node.png │ ├── ftv2ns.png │ ├── ftv2plastnode.png │ ├── ftv2pnode.png │ ├── ftv2splitbar.png │ ├── ftv2vertline.png │ ├── functions.html │ ├── functions_func.html │ ├── functions_type.html │ ├── functions_vars.html │ ├── globals.html │ ├── globals_func.html │ ├── index.html │ ├── ioflags_8hpp.html │ ├── ioflags_8hpp_source.html │ ├── jquery.js │ ├── list4701_8cpp_source.html │ ├── nav_f.png │ ├── nav_g.png │ ├── nav_h.png │ ├── open.png │ ├── sync_off.png │ ├── sync_on.png │ ├── tab_a.png │ ├── tab_b.png │ ├── tab_h.png │ ├── tab_s.png │ ├── tabs.css │ ├── test_8cpp.html │ ├── test_8cpp_source.html │ └── test_8hpp_source.html ├── ioflags.hpp ├── list4701.cpp ├── test.cpp └── test.hpp ├── chapter48 ├── gcd.hpp ├── list4801.cpp ├── list4802.cpp ├── list4803.cpp ├── list4804.cpp ├── list4805.cpp ├── list4806.cpp ├── list4807.cpp ├── list4808.cpp ├── list4809.hpp ├── list4810.cpp ├── rational.cpp └── rational.hpp ├── chapter49 ├── list4901.cpp ├── list4902.cpp ├── list4903.hpp ├── list4904.cpp ├── list4905.cpp ├── list4906.cpp ├── list4907.cpp ├── list4908.cpp ├── list4909.cpp └── rational.hpp ├── chapter50 ├── list5001.cpp ├── list5002.cpp ├── list5003.cpp ├── list5004.cpp ├── list5005.cpp └── list5006.cpp ├── chapter51 ├── list5101.cpp ├── list5102.cpp ├── list5103.cpp ├── list5104.cpp ├── list5105.cpp ├── list5106.cpp └── list5107.cpp ├── chapter52 ├── list5201.cpp ├── list5202.cpp ├── list5203.cpp ├── list5204.cpp ├── list5205.cpp ├── list5206.cpp ├── list5207.cpp ├── list5208.cpp ├── list5209.cpp ├── list5210.cpp ├── list5211.cpp └── list5212.cpp ├── chapter53 ├── card.hpp ├── erase_less.hpp ├── list5301.cpp ├── list5302.cpp ├── list5303.hpp ├── list5304.cpp ├── list5305.hpp ├── list5306.cpp ├── list5307.cpp ├── list5308.cpp ├── list5309.cpp ├── list5310.cpp ├── list5311.cpp ├── list5312.cpp └── randomint.hpp ├── chapter54 ├── ioflags.hpp ├── list5401.cpp ├── list5402.cpp ├── list5403.cpp ├── list5404.cpp ├── list5405.cpp └── list5406.cpp ├── chapter55 ├── list5501.cpp ├── list5502.cpp ├── list5503.cpp └── palindrome.cpp ├── chapter56 ├── debug.hpp ├── list5601.hpp ├── list5602.cpp ├── list5603.cpp ├── list5604.cpp ├── list5605.cpp ├── list5606.cpp ├── list5607.cpp ├── list5608.cpp ├── list5609.hpp ├── list5610.hpp ├── list5611.hpp ├── list5612.hpp ├── list5613.cpp ├── list5614.hpp ├── list5615.hpp ├── list5616.hpp └── list5617.cpp ├── chapter57 ├── Doxyfile ├── Makefile ├── currency.hpp ├── fixed.hpp ├── gcd.cpp ├── gcd.hpp ├── html │ ├── annotated.html │ ├── bc_s.png │ ├── bdwn.png │ ├── classcurrency-members.html │ ├── classcurrency.html │ ├── classes.html │ ├── classfixed-members.html │ ├── classfixed.html │ ├── classioflags-members.html │ ├── classioflags.html │ ├── classrational-members.html │ ├── classrational.html │ ├── classrational_1_1zero__denominator-members.html │ ├── classrational_1_1zero__denominator.html │ ├── classrational_1_1zero__denominator.png │ ├── closed.png │ ├── currency_8hpp.html │ ├── currency_8hpp_source.html │ ├── doxygen.css │ ├── doxygen.png │ ├── dynsections.js │ ├── files.html │ ├── fixed_8hpp.html │ ├── fixed_8hpp_source.html │ ├── ftv2blank.png │ ├── ftv2cl.png │ ├── ftv2doc.png │ ├── ftv2folderclosed.png │ ├── ftv2folderopen.png │ ├── ftv2lastnode.png │ ├── ftv2link.png │ ├── ftv2mlastnode.png │ ├── ftv2mnode.png │ ├── ftv2mo.png │ ├── ftv2node.png │ ├── ftv2ns.png │ ├── ftv2plastnode.png │ ├── ftv2pnode.png │ ├── ftv2splitbar.png │ ├── ftv2vertline.png │ ├── functions.html │ ├── functions_func.html │ ├── functions_type.html │ ├── functions_vars.html │ ├── gcd_8cpp_source.html │ ├── gcd_8hpp_source.html │ ├── globals.html │ ├── globals_func.html │ ├── hierarchy.html │ ├── index.html │ ├── ioflags_8hpp.html │ ├── ioflags_8hpp_source.html │ ├── jquery.js │ ├── nav_f.png │ ├── nav_g.png │ ├── nav_h.png │ ├── open.png │ ├── power10_8hpp_source.html │ ├── rational_8hpp_source.html │ ├── sync_off.png │ ├── sync_on.png │ ├── tab_a.png │ ├── tab_b.png │ ├── tab_h.png │ ├── tab_s.png │ ├── tabs.css │ ├── test_8cpp.html │ ├── test_8cpp_source.html │ └── test_8hpp_source.html ├── ioflags.hpp ├── power10.hpp ├── rational.hpp ├── test.cpp └── test.hpp ├── chapter58 ├── artifact.hpp ├── list5801.hpp ├── list5802.cpp ├── list5803.hpp ├── list5804.cpp ├── list5805.cpp └── topological_sort.hpp ├── chapter59 ├── all.cpp ├── artifact.hpp ├── list5901.cpp ├── list5902.cpp ├── list5903.cpp ├── list5904.cpp ├── list5905.hpp ├── list5906.hpp ├── list5907.cpp ├── list5908.cpp ├── list5909.cpp ├── list5910.cpp ├── topological_sort.hpp └── variables.hpp ├── chapter60 ├── list6001.cpp ├── list6002.cpp ├── list6003.cpp └── list6004.cpp ├── chapter61 ├── list6101.cpp ├── list6102.cpp ├── list6103.cpp ├── list6104.cpp ├── list6105.cpp ├── list6106.cpp ├── list6107.cpp └── list6108.cpp ├── chapter62 ├── list6201.cpp ├── list6202.cpp ├── list6203.cpp ├── list6204.cpp └── list6205.cpp ├── chapter63 ├── all.cpp ├── artifact.hpp ├── artifact_hash.hpp ├── artifact_impl.hpp ├── depgraph.hpp ├── list6301.cpp ├── list6302.cpp ├── list6303.hpp ├── list6304.cpp ├── list6305.hpp ├── list6306.cpp ├── topological_sort.hpp └── variables.hpp ├── chapter64 ├── list6401.cpp ├── list6402.cpp ├── list6403.cpp ├── list6404.cpp ├── list6405.cpp ├── list6406.cpp ├── list6407.cpp ├── list6408.cpp ├── list6409.cpp ├── list6410.cpp ├── list6411.cpp ├── list6412.cpp ├── list6413.cpp ├── list6414.cpp └── list6415.cpp ├── chapter65 ├── card.hpp ├── list6501.cpp ├── list6502.cpp ├── list6503.cpp └── list6504.hpp ├── chapter66 ├── assignment_mixin.hpp ├── hash.hpp ├── list6601.cpp ├── list6602.cpp ├── list6603.cpp ├── list6604.cpp ├── list6605.cpp ├── list6606.hpp ├── list6607.cpp ├── list6608.hpp ├── list6609.cpp ├── list6610.cpp └── string_pool.hpp ├── chapter67 ├── advance.hpp ├── list6701.hpp ├── list6702.cpp ├── list6703.cpp ├── list6704.cpp ├── list6705.cpp ├── list6706.cpp ├── list6707.cpp ├── list6708.cpp ├── list6709.cpp ├── rational.cpp └── rational.hpp ├── chapter68 ├── gcd.hpp ├── ioflags.hpp ├── list6801.cpp ├── list6802.cpp ├── list6803.cpp ├── list6804.cpp └── rational.hpp ├── chapter69 ├── list6901.cpp ├── list6902.cpp ├── list6903.cpp ├── list6904.cpp ├── list6905.cpp └── list6906.cpp ├── chapter70 ├── list7001.cpp ├── list7002.cpp ├── list7003.cpp ├── list7004.cpp ├── list7005.cpp ├── list7006.cpp ├── list7007.cpp ├── list7008.cpp ├── list7009.cpp ├── list7010.cpp ├── list7011.cpp ├── list7012.cpp └── list7013.cpp ├── chapter71 ├── index.html ├── step1 │ ├── Doxyfile │ ├── Makefile │ ├── calc.cpp │ ├── html │ │ ├── annotated.html │ │ ├── bc_s.png │ │ ├── bdwn.png │ │ ├── calc_8cpp.html │ │ ├── calc_8cpp_source.html │ │ ├── classes.html │ │ ├── classparse__error-members.html │ │ ├── classparse__error.html │ │ ├── classparse__error.png │ │ ├── classparser-members.html │ │ ├── classparser.html │ │ ├── closed.png │ │ ├── doxygen.css │ │ ├── doxygen.png │ │ ├── dynsections.js │ │ ├── files.html │ │ ├── ftv2blank.png │ │ ├── ftv2cl.png │ │ ├── ftv2doc.png │ │ ├── ftv2folderclosed.png │ │ ├── ftv2folderopen.png │ │ ├── ftv2lastnode.png │ │ ├── ftv2link.png │ │ ├── ftv2mlastnode.png │ │ ├── ftv2mnode.png │ │ ├── ftv2mo.png │ │ ├── ftv2node.png │ │ ├── ftv2ns.png │ │ ├── ftv2plastnode.png │ │ ├── ftv2pnode.png │ │ ├── ftv2splitbar.png │ │ ├── ftv2vertline.png │ │ ├── functions.html │ │ ├── functions_func.html │ │ ├── functions_vars.html │ │ ├── globals.html │ │ ├── globals_defs.html │ │ ├── globals_func.html │ │ ├── hierarchy.html │ │ ├── index.html │ │ ├── jquery.js │ │ ├── nav_f.png │ │ ├── nav_g.png │ │ ├── nav_h.png │ │ ├── open.png │ │ ├── parse_8cpp.html │ │ ├── parse_8cpp_source.html │ │ ├── parse_8hpp.html │ │ ├── parse_8hpp_source.html │ │ ├── sync_off.png │ │ ├── sync_on.png │ │ ├── tab_a.png │ │ ├── tab_b.png │ │ ├── tab_h.png │ │ ├── tab_s.png │ │ ├── tabs.css │ │ ├── test__main_8cpp.html │ │ ├── test__main_8cpp_source.html │ │ ├── test__parse_8cpp.html │ │ └── test__parse_8cpp_source.html │ ├── parse.cpp │ ├── parse.hpp │ ├── test_main.cpp │ └── test_parse.cpp ├── step2 │ ├── Doxyfile │ ├── Makefile │ ├── calc.cpp │ ├── html │ │ ├── annotated.html │ │ ├── bc_s.png │ │ ├── bdwn.png │ │ ├── calc_8cpp.html │ │ ├── calc_8cpp_source.html │ │ ├── classes.html │ │ ├── classparse__error-members.html │ │ ├── classparse__error.html │ │ ├── classparse__error.png │ │ ├── classparser-members.html │ │ ├── classparser.html │ │ ├── closed.png │ │ ├── doxygen.css │ │ ├── doxygen.png │ │ ├── dynsections.js │ │ ├── files.html │ │ ├── ftv2blank.png │ │ ├── ftv2cl.png │ │ ├── ftv2doc.png │ │ ├── ftv2folderclosed.png │ │ ├── ftv2folderopen.png │ │ ├── ftv2lastnode.png │ │ ├── ftv2link.png │ │ ├── ftv2mlastnode.png │ │ ├── ftv2mnode.png │ │ ├── ftv2mo.png │ │ ├── ftv2node.png │ │ ├── ftv2ns.png │ │ ├── ftv2plastnode.png │ │ ├── ftv2pnode.png │ │ ├── ftv2splitbar.png │ │ ├── ftv2vertline.png │ │ ├── functions.html │ │ ├── functions_enum.html │ │ ├── functions_eval.html │ │ ├── functions_func.html │ │ ├── functions_vars.html │ │ ├── globals.html │ │ ├── globals_defs.html │ │ ├── globals_func.html │ │ ├── hierarchy.html │ │ ├── index.html │ │ ├── jquery.js │ │ ├── nav_f.png │ │ ├── nav_g.png │ │ ├── nav_h.png │ │ ├── open.png │ │ ├── parse_8cpp.html │ │ ├── parse_8cpp_source.html │ │ ├── parse_8hpp.html │ │ ├── parse_8hpp_source.html │ │ ├── sync_off.png │ │ ├── sync_on.png │ │ ├── tab_a.png │ │ ├── tab_b.png │ │ ├── tab_h.png │ │ ├── tab_s.png │ │ ├── tabs.css │ │ ├── test__main_8cpp.html │ │ ├── test__main_8cpp_source.html │ │ ├── test__parse_8cpp.html │ │ ├── test__parse_8cpp_source.html │ │ ├── variables_8cpp.html │ │ ├── variables_8cpp_source.html │ │ ├── variables_8hpp.html │ │ └── variables_8hpp_source.html │ ├── parse.cpp │ ├── parse.hpp │ ├── test_main.cpp │ ├── test_parse.cpp │ ├── variables.cpp │ └── variables.hpp ├── step3 │ ├── Doxyfile │ ├── Makefile │ ├── calc.cpp │ ├── html │ │ ├── annotated.html │ │ ├── bc_s.png │ │ ├── bdwn.png │ │ ├── calc_8cpp.html │ │ ├── calc_8cpp_source.html │ │ ├── classes.html │ │ ├── classnode-members.html │ │ ├── classnode.html │ │ ├── classnode__add-members.html │ │ ├── classnode__add.html │ │ ├── classnode__add.png │ │ ├── classnode__assign-members.html │ │ ├── classnode__assign.html │ │ ├── classnode__assign.png │ │ ├── classnode__binary-members.html │ │ ├── classnode__binary.html │ │ ├── classnode__binary.png │ │ ├── classnode__divide-members.html │ │ ├── classnode__divide.html │ │ ├── classnode__divide.png │ │ ├── classnode__identifier-members.html │ │ ├── classnode__identifier.html │ │ ├── classnode__identifier.png │ │ ├── classnode__impl-members.html │ │ ├── classnode__impl.html │ │ ├── classnode__impl.png │ │ ├── classnode__multiply-members.html │ │ ├── classnode__multiply.html │ │ ├── classnode__multiply.png │ │ ├── classnode__negate-members.html │ │ ├── classnode__negate.html │ │ ├── classnode__negate.png │ │ ├── classnode__number-members.html │ │ ├── classnode__number.html │ │ ├── classnode__number.png │ │ ├── classnode__subtract-members.html │ │ ├── classnode__subtract.html │ │ ├── classnode__subtract.png │ │ ├── classnode__unary-members.html │ │ ├── classnode__unary.html │ │ ├── classnode__unary.png │ │ ├── classnode__void-members.html │ │ ├── classnode__void.html │ │ ├── classnode__void.png │ │ ├── classparse__error-members.html │ │ ├── classparse__error.html │ │ ├── classparse__error.png │ │ ├── classparser-members.html │ │ ├── classparser.html │ │ ├── closed.png │ │ ├── doxygen.css │ │ ├── doxygen.png │ │ ├── dynsections.js │ │ ├── files.html │ │ ├── ftv2blank.png │ │ ├── ftv2cl.png │ │ ├── ftv2doc.png │ │ ├── ftv2folderclosed.png │ │ ├── ftv2folderopen.png │ │ ├── ftv2lastnode.png │ │ ├── ftv2link.png │ │ ├── ftv2mlastnode.png │ │ ├── ftv2mnode.png │ │ ├── ftv2mo.png │ │ ├── ftv2node.png │ │ ├── ftv2ns.png │ │ ├── ftv2plastnode.png │ │ ├── ftv2pnode.png │ │ ├── ftv2splitbar.png │ │ ├── ftv2vertline.png │ │ ├── functions.html │ │ ├── functions_enum.html │ │ ├── functions_eval.html │ │ ├── functions_func.html │ │ ├── functions_vars.html │ │ ├── globals.html │ │ ├── globals_defs.html │ │ ├── globals_func.html │ │ ├── hierarchy.html │ │ ├── index.html │ │ ├── jquery.js │ │ ├── nav_f.png │ │ ├── nav_g.png │ │ ├── nav_h.png │ │ ├── node_8cpp.html │ │ ├── node_8cpp_source.html │ │ ├── node_8hpp.html │ │ ├── node_8hpp_source.html │ │ ├── node__impl_8cpp.html │ │ ├── node__impl_8cpp_source.html │ │ ├── node__impl_8hpp.html │ │ ├── node__impl_8hpp_source.html │ │ ├── open.png │ │ ├── parse_8cpp.html │ │ ├── parse_8cpp_source.html │ │ ├── parse_8hpp.html │ │ ├── parse_8hpp_source.html │ │ ├── sync_off.png │ │ ├── sync_on.png │ │ ├── tab_a.png │ │ ├── tab_b.png │ │ ├── tab_h.png │ │ ├── tab_s.png │ │ ├── tabs.css │ │ ├── test__main_8cpp.html │ │ ├── test__main_8cpp_source.html │ │ ├── test__node_8cpp.html │ │ ├── test__node_8cpp_source.html │ │ ├── test__parse_8cpp.html │ │ ├── test__parse_8cpp_source.html │ │ ├── variables_8cpp.html │ │ ├── variables_8cpp_source.html │ │ ├── variables_8hpp.html │ │ └── variables_8hpp_source.html │ ├── node.cpp │ ├── node.hpp │ ├── node_impl.cpp │ ├── node_impl.hpp │ ├── parse.cpp │ ├── parse.hpp │ ├── test_main.cpp │ ├── test_node.cpp │ ├── test_parse.cpp │ ├── variables.cpp │ └── variables.hpp ├── step4 │ ├── Doxyfile │ ├── Makefile │ ├── calc.cpp │ ├── calc_error.cpp │ ├── calc_error.hpp │ ├── html │ │ ├── annotated.html │ │ ├── bc_s.png │ │ ├── bdwn.png │ │ ├── calc_8cpp.html │ │ ├── calc_8cpp_source.html │ │ ├── calc__error_8cpp.html │ │ ├── calc__error_8cpp_source.html │ │ ├── calc__error_8hpp.html │ │ ├── calc__error_8hpp_source.html │ │ ├── classcalc__error-members.html │ │ ├── classcalc__error.html │ │ ├── classcalc__error.png │ │ ├── classes.html │ │ ├── classfunction__error-members.html │ │ ├── classfunction__error.html │ │ ├── classfunction__error.png │ │ ├── classno__such__function-members.html │ │ ├── classno__such__function.html │ │ ├── classno__such__function.png │ │ ├── classnode-members.html │ │ ├── classnode.html │ │ ├── classnode__add-members.html │ │ ├── classnode__add.html │ │ ├── classnode__add.png │ │ ├── classnode__binary-members.html │ │ ├── classnode__binary.html │ │ ├── classnode__binary.png │ │ ├── classnode__divide-members.html │ │ ├── classnode__divide.html │ │ ├── classnode__divide.png │ │ ├── classnode__function-members.html │ │ ├── classnode__function.html │ │ ├── classnode__function.png │ │ ├── classnode__function__call-members.html │ │ ├── classnode__function__call.html │ │ ├── classnode__function__call.png │ │ ├── classnode__identifier-members.html │ │ ├── classnode__identifier.html │ │ ├── classnode__identifier.png │ │ ├── classnode__impl-members.html │ │ ├── classnode__impl.html │ │ ├── classnode__impl.png │ │ ├── classnode__multiply-members.html │ │ ├── classnode__multiply.html │ │ ├── classnode__multiply.png │ │ ├── classnode__negate-members.html │ │ ├── classnode__negate.html │ │ ├── classnode__negate.png │ │ ├── classnode__number-members.html │ │ ├── classnode__number.html │ │ ├── classnode__number.png │ │ ├── classnode__subtract-members.html │ │ ├── classnode__subtract.html │ │ ├── classnode__subtract.png │ │ ├── classnode__unary-members.html │ │ ├── classnode__unary.html │ │ ├── classnode__unary.png │ │ ├── classnode__void-members.html │ │ ├── classnode__void.html │ │ ├── classnode__void.png │ │ ├── classparse__error-members.html │ │ ├── classparse__error.html │ │ ├── classparse__error.png │ │ ├── classparser-members.html │ │ ├── classparser.html │ │ ├── classset__symbol__table-members.html │ │ ├── classset__symbol__table.html │ │ ├── classsyntax__error-members.html │ │ ├── classsyntax__error.html │ │ ├── classsyntax__error.png │ │ ├── closed.png │ │ ├── doxygen.css │ │ ├── doxygen.png │ │ ├── dynsections.js │ │ ├── files.html │ │ ├── ftv2blank.png │ │ ├── ftv2cl.png │ │ ├── ftv2doc.png │ │ ├── ftv2folderclosed.png │ │ ├── ftv2folderopen.png │ │ ├── ftv2lastnode.png │ │ ├── ftv2link.png │ │ ├── ftv2mlastnode.png │ │ ├── ftv2mnode.png │ │ ├── ftv2mo.png │ │ ├── ftv2node.png │ │ ├── ftv2ns.png │ │ ├── ftv2plastnode.png │ │ ├── ftv2pnode.png │ │ ├── ftv2splitbar.png │ │ ├── ftv2vertline.png │ │ ├── functions.html │ │ ├── functions_enum.html │ │ ├── functions_eval.html │ │ ├── functions_func.html │ │ ├── functions_vars.html │ │ ├── globals.html │ │ ├── globals_defs.html │ │ ├── globals_func.html │ │ ├── globals_type.html │ │ ├── hierarchy.html │ │ ├── index.html │ │ ├── jquery.js │ │ ├── nav_f.png │ │ ├── nav_g.png │ │ ├── nav_h.png │ │ ├── node_8cpp.html │ │ ├── node_8cpp_source.html │ │ ├── node_8hpp.html │ │ ├── node_8hpp_source.html │ │ ├── node__impl_8cpp.html │ │ ├── node__impl_8cpp_source.html │ │ ├── node__impl_8hpp.html │ │ ├── node__impl_8hpp_source.html │ │ ├── open.png │ │ ├── parse_8cpp.html │ │ ├── parse_8cpp_source.html │ │ ├── parse_8hpp.html │ │ ├── parse_8hpp_source.html │ │ ├── sync_off.png │ │ ├── sync_on.png │ │ ├── tab_a.png │ │ ├── tab_b.png │ │ ├── tab_h.png │ │ ├── tab_s.png │ │ ├── tabs.css │ │ ├── test__main_8cpp.html │ │ ├── test__main_8cpp_source.html │ │ ├── test__node_8cpp.html │ │ ├── test__node_8cpp_source.html │ │ ├── test__parse_8cpp.html │ │ ├── test__parse_8cpp_source.html │ │ ├── variables_8cpp.html │ │ ├── variables_8cpp_source.html │ │ ├── variables_8hpp.html │ │ └── variables_8hpp_source.html │ ├── node.cpp │ ├── node.hpp │ ├── node_impl.cpp │ ├── node_impl.hpp │ ├── parse.cpp │ ├── parse.hpp │ ├── test_main.cpp │ ├── test_node.cpp │ ├── test_parse.cpp │ ├── variables.cpp │ └── variables.hpp ├── step5 │ ├── Doxyfile │ ├── Makefile │ ├── calc.cpp │ ├── calc_error.cpp │ ├── calc_error.hpp │ ├── html │ │ ├── annotated.html │ │ ├── bc_s.png │ │ ├── bdwn.png │ │ ├── calc_8cpp.html │ │ ├── calc_8cpp_source.html │ │ ├── calc__error_8cpp.html │ │ ├── calc__error_8cpp_source.html │ │ ├── calc__error_8hpp.html │ │ ├── calc__error_8hpp_source.html │ │ ├── classcalc__error-members.html │ │ ├── classcalc__error.html │ │ ├── classcalc__error.png │ │ ├── classes.html │ │ ├── classfile__error-members.html │ │ ├── classfile__error.html │ │ ├── classfile__error.png │ │ ├── classfunction__error-members.html │ │ ├── classfunction__error.html │ │ ├── classfunction__error.png │ │ ├── classno__such__function-members.html │ │ ├── classno__such__function.html │ │ ├── classno__such__function.png │ │ ├── classnode-members.html │ │ ├── classnode.html │ │ ├── classnode__add-members.html │ │ ├── classnode__add.html │ │ ├── classnode__add.png │ │ ├── classnode__binary-members.html │ │ ├── classnode__binary.html │ │ ├── classnode__binary.png │ │ ├── classnode__divide-members.html │ │ ├── classnode__divide.html │ │ ├── classnode__divide.png │ │ ├── classnode__function-members.html │ │ ├── classnode__function.html │ │ ├── classnode__function.png │ │ ├── classnode__function__call-members.html │ │ ├── classnode__function__call.html │ │ ├── classnode__function__call.png │ │ ├── classnode__identifier-members.html │ │ ├── classnode__identifier.html │ │ ├── classnode__identifier.png │ │ ├── classnode__impl-members.html │ │ ├── classnode__impl.html │ │ ├── classnode__impl.png │ │ ├── classnode__multiply-members.html │ │ ├── classnode__multiply.html │ │ ├── classnode__multiply.png │ │ ├── classnode__negate-members.html │ │ ├── classnode__negate.html │ │ ├── classnode__negate.png │ │ ├── classnode__number-members.html │ │ ├── classnode__number.html │ │ ├── classnode__number.png │ │ ├── classnode__subtract-members.html │ │ ├── classnode__subtract.html │ │ ├── classnode__subtract.png │ │ ├── classnode__unary-members.html │ │ ├── classnode__unary.html │ │ ├── classnode__unary.png │ │ ├── classnode__void-members.html │ │ ├── classnode__void.html │ │ ├── classnode__void.png │ │ ├── classparse__error-members.html │ │ ├── classparse__error.html │ │ ├── classparse__error.png │ │ ├── classparser-members.html │ │ ├── classparser.html │ │ ├── classset__symbol__table-members.html │ │ ├── classset__symbol__table.html │ │ ├── classsyntax__error-members.html │ │ ├── classsyntax__error.html │ │ ├── classsyntax__error.png │ │ ├── closed.png │ │ ├── doxygen.css │ │ ├── doxygen.png │ │ ├── dynsections.js │ │ ├── files.html │ │ ├── ftv2blank.png │ │ ├── ftv2cl.png │ │ ├── ftv2doc.png │ │ ├── ftv2folderclosed.png │ │ ├── ftv2folderopen.png │ │ ├── ftv2lastnode.png │ │ ├── ftv2link.png │ │ ├── ftv2mlastnode.png │ │ ├── ftv2mnode.png │ │ ├── ftv2mo.png │ │ ├── ftv2node.png │ │ ├── ftv2ns.png │ │ ├── ftv2plastnode.png │ │ ├── ftv2pnode.png │ │ ├── ftv2splitbar.png │ │ ├── ftv2vertline.png │ │ ├── functions.html │ │ ├── functions_enum.html │ │ ├── functions_eval.html │ │ ├── functions_func.html │ │ ├── functions_vars.html │ │ ├── globals.html │ │ ├── globals_defs.html │ │ ├── globals_func.html │ │ ├── globals_type.html │ │ ├── hierarchy.html │ │ ├── index.html │ │ ├── jquery.js │ │ ├── nav_f.png │ │ ├── nav_g.png │ │ ├── nav_h.png │ │ ├── node_8cpp.html │ │ ├── node_8cpp_source.html │ │ ├── node_8hpp.html │ │ ├── node_8hpp_source.html │ │ ├── node__impl_8cpp.html │ │ ├── node__impl_8cpp_source.html │ │ ├── node__impl_8hpp.html │ │ ├── node__impl_8hpp_source.html │ │ ├── open.png │ │ ├── parse_8cpp.html │ │ ├── parse_8cpp_source.html │ │ ├── parse_8hpp.html │ │ ├── parse_8hpp_source.html │ │ ├── sync_off.png │ │ ├── sync_on.png │ │ ├── tab_a.png │ │ ├── tab_b.png │ │ ├── tab_h.png │ │ ├── tab_s.png │ │ ├── tabs.css │ │ ├── test__main_8cpp.html │ │ ├── test__main_8cpp_source.html │ │ ├── test__node_8cpp.html │ │ ├── test__node_8cpp_source.html │ │ ├── test__parse_8cpp.html │ │ ├── test__parse_8cpp_source.html │ │ ├── variables_8cpp.html │ │ ├── variables_8cpp_source.html │ │ ├── variables_8hpp.html │ │ └── variables_8hpp_source.html │ ├── node.cpp │ ├── node.hpp │ ├── node_impl.cpp │ ├── node_impl.hpp │ ├── parse.cpp │ ├── parse.hpp │ ├── test_main.cpp │ ├── test_node.cpp │ ├── test_parse.cpp │ ├── variables.cpp │ └── variables.hpp └── step6 │ ├── Doxyfile │ ├── Makefile │ ├── calc.cpp │ ├── calc_error.cpp │ ├── calc_error.hpp │ ├── gcd.hpp │ ├── html │ ├── annotated.html │ ├── bc_s.png │ ├── bdwn.png │ ├── calc_8cpp.html │ ├── calc_8cpp_source.html │ ├── calc__error_8cpp.html │ ├── calc__error_8cpp_source.html │ ├── calc__error_8hpp.html │ ├── calc__error_8hpp_source.html │ ├── classcalc__error-members.html │ ├── classcalc__error.html │ ├── classcalc__error.png │ ├── classes.html │ ├── classfile__error-members.html │ ├── classfile__error.html │ ├── classfile__error.png │ ├── classfunction__error-members.html │ ├── classfunction__error.html │ ├── classfunction__error.png │ ├── classioflags-members.html │ ├── classioflags.html │ ├── classno__such__function-members.html │ ├── classno__such__function.html │ ├── classno__such__function.png │ ├── classnode-members.html │ ├── classnode.html │ ├── classnode__add-members.html │ ├── classnode__add.html │ ├── classnode__add.png │ ├── classnode__binary-members.html │ ├── classnode__binary.html │ ├── classnode__binary.png │ ├── classnode__divide-members.html │ ├── classnode__divide.html │ ├── classnode__divide.png │ ├── classnode__function-members.html │ ├── classnode__function.html │ ├── classnode__function.png │ ├── classnode__function__call-members.html │ ├── classnode__function__call.html │ ├── classnode__function__call.png │ ├── classnode__identifier-members.html │ ├── classnode__identifier.html │ ├── classnode__identifier.png │ ├── classnode__impl-members.html │ ├── classnode__impl.html │ ├── classnode__impl.png │ ├── classnode__multiply-members.html │ ├── classnode__multiply.html │ ├── classnode__multiply.png │ ├── classnode__negate-members.html │ ├── classnode__negate.html │ ├── classnode__negate.png │ ├── classnode__number-members.html │ ├── classnode__number.html │ ├── classnode__number.png │ ├── classnode__subtract-members.html │ ├── classnode__subtract.html │ ├── classnode__subtract.png │ ├── classnode__unary-members.html │ ├── classnode__unary.html │ ├── classnode__unary.png │ ├── classnode__void-members.html │ ├── classnode__void.html │ ├── classnode__void.png │ ├── classnumber-members.html │ ├── classnumber.html │ ├── classnumber__double-members.html │ ├── classnumber__double.html │ ├── classnumber__double.png │ ├── classnumber__impl-members.html │ ├── classnumber__impl.html │ ├── classnumber__impl.png │ ├── classnumber__long-members.html │ ├── classnumber__long.html │ ├── classnumber__long.png │ ├── classnumber__rational-members.html │ ├── classnumber__rational.html │ ├── classnumber__rational.png │ ├── classnumber__void-members.html │ ├── classnumber__void.html │ ├── classnumber__void.png │ ├── classparse__error-members.html │ ├── classparse__error.html │ ├── classparse__error.png │ ├── classparser-members.html │ ├── classparser.html │ ├── classrational-members.html │ ├── classrational.html │ ├── classset__symbol__table-members.html │ ├── classset__symbol__table.html │ ├── classsyntax__error-members.html │ ├── classsyntax__error.html │ ├── classsyntax__error.png │ ├── classzero__denominator-members.html │ ├── classzero__denominator.html │ ├── classzero__denominator.png │ ├── closed.png │ ├── doxygen.css │ ├── doxygen.png │ ├── dynsections.js │ ├── files.html │ ├── ftv2blank.png │ ├── ftv2cl.png │ ├── ftv2doc.png │ ├── ftv2folderclosed.png │ ├── ftv2folderopen.png │ ├── ftv2lastnode.png │ ├── ftv2link.png │ ├── ftv2mlastnode.png │ ├── ftv2mnode.png │ ├── ftv2mo.png │ ├── ftv2node.png │ ├── ftv2ns.png │ ├── ftv2plastnode.png │ ├── ftv2pnode.png │ ├── ftv2splitbar.png │ ├── ftv2vertline.png │ ├── functions.html │ ├── functions_0x63.html │ ├── functions_0x64.html │ ├── functions_0x65.html │ ├── functions_0x66.html │ ├── functions_0x67.html │ ├── functions_0x69.html │ ├── functions_0x6b.html │ ├── functions_0x6c.html │ ├── functions_0x6d.html │ ├── functions_0x6e.html │ ├── functions_0x6f.html │ ├── functions_0x70.html │ ├── functions_0x72.html │ ├── functions_0x73.html │ ├── functions_0x74.html │ ├── functions_0x76.html │ ├── functions_0x7a.html │ ├── functions_0x7e.html │ ├── functions_enum.html │ ├── functions_eval.html │ ├── functions_func.html │ ├── functions_func_0x63.html │ ├── functions_func_0x64.html │ ├── functions_func_0x65.html │ ├── functions_func_0x66.html │ ├── functions_func_0x67.html │ ├── functions_func_0x69.html │ ├── functions_func_0x6c.html │ ├── functions_func_0x6d.html │ ├── functions_func_0x6e.html │ ├── functions_func_0x6f.html │ ├── functions_func_0x70.html │ ├── functions_func_0x72.html │ ├── functions_func_0x73.html │ ├── functions_func_0x74.html │ ├── functions_func_0x76.html │ ├── functions_func_0x7a.html │ ├── functions_func_0x7e.html │ ├── functions_type.html │ ├── functions_vars.html │ ├── gcd_8hpp.html │ ├── gcd_8hpp_source.html │ ├── globals.html │ ├── globals_defs.html │ ├── globals_func.html │ ├── globals_type.html │ ├── hierarchy.html │ ├── index.html │ ├── ioflags_8hpp.html │ ├── ioflags_8hpp_source.html │ ├── jquery.js │ ├── nav_f.png │ ├── nav_g.png │ ├── nav_h.png │ ├── node_8cpp.html │ ├── node_8cpp_source.html │ ├── node_8hpp.html │ ├── node_8hpp_source.html │ ├── node__impl_8cpp.html │ ├── node__impl_8cpp_source.html │ ├── node__impl_8hpp.html │ ├── node__impl_8hpp_source.html │ ├── number_8cpp.html │ ├── number_8cpp_source.html │ ├── number_8hpp.html │ ├── number_8hpp_source.html │ ├── number__impl_8cpp.html │ ├── number__impl_8cpp_source.html │ ├── number__impl_8hpp.html │ ├── number__impl_8hpp_source.html │ ├── open.png │ ├── parse_8cpp.html │ ├── parse_8cpp_source.html │ ├── parse_8hpp.html │ ├── parse_8hpp_source.html │ ├── power10_8hpp.html │ ├── power10_8hpp_source.html │ ├── rational_8hpp.html │ ├── rational_8hpp_source.html │ ├── sync_off.png │ ├── sync_on.png │ ├── tab_a.png │ ├── tab_b.png │ ├── tab_h.png │ ├── tab_s.png │ ├── tabs.css │ ├── test__main_8cpp.html │ ├── test__main_8cpp_source.html │ ├── test__node_8cpp.html │ ├── test__node_8cpp_source.html │ ├── test__number_8cpp.html │ ├── test__number_8cpp_source.html │ ├── test__parse_8cpp.html │ ├── test__parse_8cpp_source.html │ ├── variables_8cpp.html │ ├── variables_8cpp_source.html │ ├── variables_8hpp.html │ └── variables_8hpp_source.html │ ├── ioflags.hpp │ ├── node.cpp │ ├── node.hpp │ ├── node_impl.cpp │ ├── node_impl.hpp │ ├── number.cpp │ ├── number.hpp │ ├── number_impl.cpp │ ├── number_impl.hpp │ ├── parse.cpp │ ├── parse.hpp │ ├── power10.hpp │ ├── rational.hpp │ ├── test_main.cpp │ ├── test_node.cpp │ ├── test_number.cpp │ ├── test_parse.cpp │ ├── variables.cpp │ └── variables.hpp ├── data ├── explore15.txt ├── greek-8859-7.txt ├── greek-utf8.txt ├── hebrew-8859-8.txt ├── hebrew-utf8.txt ├── palindrome-8859-1.txt ├── palindrome-utf8.txt ├── russian-8859-5.txt ├── russian-koi8-r.txt ├── russian-utf8.txt ├── sample-euc-kr.txt ├── sample-iso-8859-5.txt ├── sample-iso-8859-7.txt ├── sample-iso8859-1.txt ├── sample-koi8-r.txt ├── sample-shift_jis.txt ├── sample-utf8.txt ├── shuffled-words.txt └── sorted-words.txt └── index.html /9781430261933.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/9781430261933.jpg -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/LICENSE.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Apress Source Code 2 | 3 | This repository accompanies [*Exploring C++ 11*](http://www.apress.com/9781430261933) by Ray Lischner (Apress, 2013). 4 | 5 | ![Cover image](9781430261933.jpg) 6 | 7 | Download the files as a zip using the green button, or clone the repository to your machine using Git. 8 | 9 | ## Releases 10 | 11 | Release v1.0 corresponds to the code in the published book, without corrections or updates. 12 | 13 | ## Contributions 14 | 15 | See the file Contributing.md for more information on how you can contribute to this repository. 16 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter02/list0203.cpp: -------------------------------------------------------------------------------- 1 | // Listing 2-3. Determining the Number of Bits in a bool 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | // Note that "digits" means binary digits, i.e., bits. 8 | std::cout << "bits per bool: " << std::numeric_limits::digits << '\n'; 9 | } 10 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter03/list0301.cpp: -------------------------------------------------------------------------------- 1 | // Listing 3-1. Integer Arithmetic 2 | /// Read the program and determine what the program does. 3 | 4 | #include 5 | 6 | int main() 7 | { 8 | int sum{0}; 9 | int count{}; 10 | int x; 11 | while (std::cin >> x) 12 | { 13 | sum = sum + x; 14 | count = count + 1; 15 | } 16 | 17 | std::cout << "average = " << sum / count << '\n'; 18 | } 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter03/list0302.cpp: -------------------------------------------------------------------------------- 1 | // Listing 3-2. Print Average, Testing for a Zero Count 2 | /// Read integers and print their average. 3 | /// Print nothing if the input is empty. 4 | 5 | #include 6 | 7 | int main() 8 | { 9 | int sum{0}; 10 | int count{}; 11 | int x; 12 | while (std::cin >> x) 13 | { 14 | sum = sum + x; 15 | count = count + 1; 16 | } 17 | 18 | if (count != 0) 19 | std::cout << "average = " << sum / count << '\n'; 20 | } 21 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter03/list0303.cpp: -------------------------------------------------------------------------------- 1 | // Listing 3-3. Testing for Even or Odd Integers 2 | /// Read integers and print a message that tells the user 3 | /// whether the number is even or odd. 4 | 5 | #include 6 | 7 | int main() 8 | { 9 | int x; 10 | while (std::cin >> x) 11 | if ( ) // Fill in the condition. 12 | std::cout << x << " is odd.\n"; 13 | else 14 | std::cout << x << " is even.\n"; 15 | } 16 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter03/list0304.cpp: -------------------------------------------------------------------------------- 1 | // Listing 3-4. Testing for Even or Odd Integers 2 | /// Read integers and print a message that tells the user 3 | /// whether the number is even or odd. 4 | 5 | #include 6 | 7 | int main() 8 | { 9 | int x; 10 | while (std::cin >> x) 11 | if ( ) // Fill in the condition. 12 | std::cout << x << " is even.\n"; 13 | else 14 | std::cout << x << " is odd.\n"; 15 | } 16 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter03/list0305.cpp: -------------------------------------------------------------------------------- 1 | // Listing 3-5. Print Average, Testing for a Zero Count 2 | /// Read integers and print their average. 3 | /// Print nothing if the input is empty. 4 | 5 | #include 6 | 7 | int main() 8 | { 9 | int sum{0}; 10 | int count{}; 11 | int x; 12 | while (std::cin >> x) 13 | { 14 | sum = sum + x; 15 | count = count + 1; 16 | } 17 | 18 | if (count == 0) 19 | std::cout << "No data.\n"; 20 | else 21 | std::cout << "average = " << sum / count << '\n'; 22 | } 23 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter04/list0401.cpp: -------------------------------------------------------------------------------- 1 | // Listing 4-1. Different Styles of String Output 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << "Shape\tSides\n" << "-----\t-----\n"; 7 | std::cout << "Square\t" << 4 << '\n' << 8 | "Circle\t?\n"; 9 | } 10 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter04/list0402.cpp: -------------------------------------------------------------------------------- 1 | // Listing 4-2. Printing a Double-Quote Character 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << "\"\n"; 7 | } 8 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter04/list0403.cpp: -------------------------------------------------------------------------------- 1 | // Listing 4-3. Adding a Triangle and Keeping the Columns Aligned 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << "Shape\t\tSides\n" << 7 | "-----\t\t-----\n"; 8 | std::cout << "Square\t\t" << 4 << '\n' << 9 | "Circle\t\t?\n" 10 | "Triangle\t" << 3 << '\n'; 11 | } 12 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter04/list0404.cpp: -------------------------------------------------------------------------------- 1 | // Listing 4-4. Printing Information That Is Stored in Variables 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::string shape{"Triangle"}; 8 | int sides{3}; 9 | 10 | std::cout << "Shape\t\tSides\n" << 11 | "-----\t\t-----\n"; 12 | std::cout << "Square\t\t" << 4 << '\n' << 13 | "Circle\t\t?\n"; 14 | std::cout << shape << '\t' << sides << '\n'; 15 | } 16 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter04/list0405.cpp: -------------------------------------------------------------------------------- 1 | // Listing 4-5. Defining and Printing an Empty String 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::string empty; 8 | std::cout << "|" << empty << "|\n"; 9 | } 10 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter04/list0406.cpp: -------------------------------------------------------------------------------- 1 | // Listing 4-6. Demonstrating Uninitialized Variables 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::string shape; 8 | int sides; 9 | 10 | std::cout << "Shape\t\tSides\n" << 11 | "-----\t\t-----\n"; 12 | std::cout << "Square\t\t" << 4 << '\n' << 13 | "Circle\t\t?\n"; 14 | std::cout << shape << '\t' << sides << '\n'; 15 | } 16 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter05/list0501.cpp: -------------------------------------------------------------------------------- 1 | // Listing 5-1. Demonstrating Input and Output 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << "Enter a number: "; 7 | int x; 8 | std::cin >> x; 9 | std::cout << "Enter another number: "; 10 | int y; 11 | std::cin >> y; 12 | 13 | int z{x + y}; 14 | std::cout << "The sum of " << x << " and " << y << " is " << z << "\n"; 15 | } 16 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter05/list0502.cpp: -------------------------------------------------------------------------------- 1 | // Listing 5-2. Reading Strings 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::cout << "What is your name? "; 8 | std::string name{}; 9 | std::cin >> name; 10 | std::cout << "Hello, " << name << ", how are you? "; 11 | std::string response{}; 12 | std::cin >> response; 13 | std::cout << "Good-bye, " << name << ". I'm glad you feel " << response << "\n"; 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter05/list0503.cpp: -------------------------------------------------------------------------------- 1 | // Listing 5-3. Getting the User’s Name and Age 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::cout << "What is your name? "; 8 | std::string name{}; 9 | std::cin >> name; 10 | 11 | std::cout << "Hello, " << name << ", how old are you? "; 12 | int age{}; 13 | std::cin >> age; 14 | 15 | std::cout << "Good-bye, " << name << ". You are " << age << " year"; 16 | if (age != 1) 17 | std::cout << 's'; 18 | std::cout << " old.\n"; 19 | } 20 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter05/list0504.cpp: -------------------------------------------------------------------------------- 1 | // Listing 5-4. Getting the User’s Age and Then Name 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::cout << "How old are you? "; 8 | int age{}; 9 | std::cin >> age; 10 | 11 | std::cout << "What is your name? "; 12 | std::string name{}; 13 | std::cin >> name; 14 | 15 | std::cout << "Good-bye, " << name << ". You are " << age << " year"; 16 | if (age != 1) 17 | std::cout << 's'; 18 | std::cout << " old.\n"; 19 | } 20 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter07/list0701.cpp: -------------------------------------------------------------------------------- 1 | // Listing 7-1. Using a for Loop to Print Ten Non-Negative Numbers 2 | #include 3 | 4 | int main() 5 | { 6 | for (int i{0}; i != 10; i = i + 1) 7 | std::cout << i << '\n'; 8 | } 9 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter07/list0702.cpp: -------------------------------------------------------------------------------- 1 | // Listing 7-2. You Cannot Use the Loop Control Variable Outside the Loop 2 | #include 3 | 4 | int main() 5 | { 6 | for (int i{0}; i != 10; i = i + 1) 7 | std::cout << i << '\n'; 8 | std::cout << "i=" << i << '\n'; // error: i is undefined outside the loop 9 | } 10 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter07/list0703.cpp: -------------------------------------------------------------------------------- 1 | // Listing 7-3. Using and Reusing a Loop Control Variable Name 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << '+'; 7 | for (int i{0}; i != 20; i = i + 1) 8 | std::cout << '-'; 9 | std::cout << "+\n|"; 10 | 11 | for (int i{0}; i != 3; i = i + 1) 12 | std::cout << ' '; 13 | std::cout << "Hello, reader!"; 14 | 15 | for (int i{0}; i != 3; i = i + 1) 16 | std::cout << ' '; 17 | std::cout << "|\n+"; 18 | 19 | for (int i{0}; i != 20; i = i + 1) 20 | std::cout << '-'; 21 | std::cout << "+\n"; 22 | } 23 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter07/list0704.cpp: -------------------------------------------------------------------------------- 1 | // Listing 7-4. Compute Sum of Integers from 10 to 20 2 | #include 3 | 4 | int main() 5 | { 6 | int sum{0}; 7 | 8 | // Write the loop here. 9 | 10 | std::cout << "Sum of 10 to 20 = " << sum << '\n'; 11 | } 12 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter07/list0705.cpp: -------------------------------------------------------------------------------- 1 | // Listing 7-5. Compute Sum of Integers from 10 to 20 (Completed) 2 | #include 3 | 4 | int main() 5 | { 6 | int sum{0}; 7 | for (int i{10}; i != 21; i = i + 1) 8 | sum = sum + i; 9 | std::cout << "Sum of 10 to 20 = " << sum << '\n'; 10 | } 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter08/list0801.cpp: -------------------------------------------------------------------------------- 1 | // Listing 8-1. Print a Table of Squares and Cubes 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::cout << " N N^2 N^3\n"; 8 | for (int i{1}; i != 21; ++i) 9 | { 10 | // write the loop body here 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter08/list0802.cpp: -------------------------------------------------------------------------------- 1 | // Listing 8-2. Printing a Table of Powers the Right Way 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::cout << " N N^2 N^3\n"; 8 | for (int i{1}; i != 21; ++i) 9 | std::cout << std::setw(2) << i 10 | << std::setw(6) << i*i 11 | << std::setw(7) << i*i*i 12 | << '\n'; 13 | } 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter08/list0804.cpp: -------------------------------------------------------------------------------- 1 | // Listing 8-4. Exploring Field Width, Fill Character, and Alignment 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | using namespace std; 8 | cout << '|' << setfill('*') << setw(6) << 1234 << '|' << '\n'; 9 | cout << '|' << left << setw(6) << 1234 << '|' << '\n'; 10 | cout << '|' << setw(6) << -1234 << '|' << '\n'; 11 | cout << '|' << right << setw(6) << -1234 << '|' << '\n'; 12 | } 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter08/list0805.cpp: -------------------------------------------------------------------------------- 1 | // Listing 8-5. Program to Produce Formatted Output 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | using namespace std; 8 | 9 | cout << setfill('0') << setw(6) << 42 << '\n'; 10 | cout << left << setw(6) << 42 << '\n'; 11 | cout << 42 << '\n'; 12 | cout << setfill('-') << setw(4) << -42 << '\n'; 13 | } 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter08/list0806.cpp: -------------------------------------------------------------------------------- 1 | // Listing 8-6. A Copy of Listing 8-5, but Using Member Functions 2 | #include 3 | 4 | int main() 5 | { 6 | using namespace std; 7 | 8 | cout.fill('0'); 9 | cout.width(6); 10 | cout << 42 << '\n'; 11 | cout.setf(ios_base::left, ios_base::adjustfield); 12 | cout.width(6); 13 | cout << 42 << '\n'; 14 | cout << 42 << '\n'; 15 | cout.fill('-'); 16 | cout.width(4); 17 | cout << -42 << '\n'; 18 | } 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter10/list1001.cpp: -------------------------------------------------------------------------------- 1 | // Listing 10-1. Demonstrating the std::copy Function 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | int main() 8 | { 9 | std::vector input{ 10, 20, 30 }; 10 | std::vector output{}; 11 | output.resize(input.size()); 12 | std::copy(input.begin(), input.end(), output.begin()); 13 | // Now output has a complete copy of input. 14 | assert(input == output); 15 | } 16 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter10/list1004.cpp: -------------------------------------------------------------------------------- 1 | // Listing 10-4. Doubling and Squaring Input Values in a Vector by Using Iterators 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::vector data{}; 9 | int x{}; 10 | 11 | while (std::cin >> x) 12 | data.push_back(x); 13 | 14 | for (std::vector::iterator i{data.begin()}, end{data.end()}; i != end; ++i) 15 | std::cout << std::setw(2) << *i << 16 | std::setw(3) << *i* 2 << 17 | std::setw(4) << *i * *i << '\n'; 18 | } 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter10/list1005.cpp: -------------------------------------------------------------------------------- 1 | // Listing 10-5. Doubling and Squaring Input Values in a Vector by Using a Range-Based Loop 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::vector data{}; 9 | int x{}; 10 | 11 | while (std::cin >> x) 12 | data.push_back(x); 13 | 14 | std::cout.fill(' '); 15 | for (int element : data) 16 | std::cout << std::setw(2) << element << 17 | std::setw(3) << element * 2 << 18 | std::setw(4) << element * element << '\n'; 19 | } 20 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter11/list1101.cpp: -------------------------------------------------------------------------------- 1 | // Listing 11-1. Demonstrating the Difference Between Prefix and Postfix Increment 2 | #include 3 | 4 | int main() 5 | { 6 | int x{42}; 7 | 8 | std::cout << "x = " << x << "\n"; 9 | std::cout << "++x = " << ++x << "\n"; 10 | std::cout << "x = " << x << "\n"; 11 | std::cout << "x++ = " << x++ << "\n"; 12 | std::cout << "x = " << x << "\n"; 13 | } 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter11/list1102.cpp: -------------------------------------------------------------------------------- 1 | // Listing 11-2. Erroneous Program That Applies Decrement to an Output Iterator 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::vector data{ 10, 42 }; 9 | std::ostream_iterator out{ std::ostream_iterator(std::cout, "") }; 10 | std::copy(data.begin(), data.end(), out); 11 | --out; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter12/list1201.cpp: -------------------------------------------------------------------------------- 1 | // Listing 12-1. Printing bool Values 2 | #include 3 | 4 | int main() 5 | { 6 | std::cout << "true=" << true << '\n'; 7 | std::cout << "false=" << false << '\n'; 8 | std::cout << std::boolalpha; 9 | std::cout << "true=" << true << '\n'; 10 | std::cout << "false=" << false << '\n'; 11 | } 12 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter12/list1203.cpp: -------------------------------------------------------------------------------- 1 | // Listing 12-3. Converting a std::string to bool 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::string empty{}; 8 | 9 | if (empty) 10 | std::cout << "empty is true\n"; 11 | else 12 | std::cout << "empty is false\n"; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter13/list1301.cpp: -------------------------------------------------------------------------------- 1 | // Listing 13-1. Finding Statement Errors 2 | #include 3 | #include 4 | // find errors in this program 5 | int main() 6 | { 7 | std::vector positive_data{}, negative_data{}; 8 | 9 | for (int x{0}; std::cin >> x ;) { 10 | if (x < 0); 11 | { 12 | negative_data.push_back(x) 13 | }; 14 | else 15 | { 16 | positive_data.push_back(x) 17 | } 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter14/list1401.cpp: -------------------------------------------------------------------------------- 1 | // Listing 14-1. Copying Integers from a File to Standard Output 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::ifstream in{"list1401.txt"}; 9 | if (not in) 10 | std::perror("list1401.txt"); 11 | else 12 | { 13 | int x{}; 14 | while (in >> x) 15 | std::cout << x << '\n'; 16 | in.close(); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter14/list1401.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | 5 6 7 8 9 6 | 7 | 10 8 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter14/list1402.in: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | 5 6 7 8 9 6 | 7 | 10 8 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter15/list1501.cpp: -------------------------------------------------------------------------------- 1 | // Listing 15-1. Counting Occurrences of Unique Words 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::map counts{}; 9 | std::string word{}; 10 | while (std::cin >> word) 11 | ++counts[word]; 12 | // TODO: Print the results. 13 | } 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter17/list1702.cpp: -------------------------------------------------------------------------------- 1 | // Listing 17-2. Echoing Input to Output, One Character at a Time 2 | #include 3 | 4 | int main() 5 | { 6 | std::cin >> std::noskipws; 7 | char ch; 8 | while (std::cin >> ch) 9 | std::cout << ch; 10 | } 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter18/list1803.cpp: -------------------------------------------------------------------------------- 1 | // Listing 18-3. Using the Native Locale for Output 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::cout.imbue(std::locale{""}); 8 | 9 | int sum{0}; 10 | int x{}; 11 | while (std::cin >> x) 12 | sum = sum + x; 13 | std::cout << "sum = " << sum << '\n'; 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter23/list2304.cpp: -------------------------------------------------------------------------------- 1 | // Listing 23-4. Using a Lambda to Access Local Variables 2 | #include 3 | 4 | int main() 5 | { 6 | int x{0}; 7 | auto lambda = [x](int y) { 8 | x = 1; 9 | y = 2; 10 | return x + y; 11 | }; 12 | int local{0}; 13 | std::cout << lambda(local) << ", " << x << ", " << local << '\n'; 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter23/list2305.cpp: -------------------------------------------------------------------------------- 1 | // Listing 23-5. Using the mutable Keyword in a Lambda 2 | #include 3 | 4 | int main() 5 | { 6 | int x{0}; 7 | auto lambda = [x](int y) mutable { 8 | x = 1; 9 | y = 2; 10 | return x + y; 11 | }; 12 | int local{0}; 13 | std::cout << lambda(local) << ", " << x << ", " << local << '\n'; 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter25/list2505.cpp: -------------------------------------------------------------------------------- 1 | // Listing 25-5. User-Defined Literal 2 | #include 3 | 4 | short operator "" _S(unsigned long long value) 5 | { 6 | return static_cast(value); 7 | } 8 | 9 | void print(short s) 10 | { 11 | std::cout << "short=" << s << '\n'; 12 | } 13 | 14 | void print(int i) 15 | { 16 | std::cout << "int=" << i << '\n'; 17 | } 18 | 19 | int main() 20 | { 21 | print(42); 22 | print(42_S); 23 | } 24 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter26/list2601.cpp: -------------------------------------------------------------------------------- 1 | // Listing 26-1. Floating-Point Numbers Do Not Always Behave As You Expect 2 | #include 3 | int main() 4 | { 5 | float a{0.03F}; 6 | float b{10.0F}; 7 | float c{0.3F}; 8 | assert(a * b == c); 9 | } 10 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/Makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS = -ansi -pedantic -Wall -std=c++11 2 | 3 | all: bmi 4 | 5 | bmi: bmi.o 6 | $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) bmi.o 7 | 8 | clean: 9 | $(RM) -r bmi bmi.o html 10 | 11 | .PHONY: all clean 12 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/bmi.in: -------------------------------------------------------------------------------- 1 | 25 -- threshold 2 | Ray Lischner 3 | 180 cm 4 | 90 kg 5 | male 6 | A. Nony Mouse 7 | 120 cm 8 | 42 kg 9 | female 10 | Mick E. Mouse 11 | 30 cm 12 | 2 kg 13 | male 14 | A. Nony Lischner 15 | 150 cm 16 | 55 kg 17 | male 18 | No One 19 | 250 cm 20 | 130 kg 21 | female 22 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/bc_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/bdwn.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/closed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/doxygen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2blank.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2cl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2cl.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2doc.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2folderclosed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2folderopen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2lastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2lastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2link.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2mlastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2mlastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2mnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2mnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2mo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2mo.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2node.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2ns.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2plastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2plastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2pnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2pnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2splitbar.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/ftv2vertline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/ftv2vertline.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/nav_f.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/nav_g.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/nav_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/open.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/sync_off.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/sync_on.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/tab_a.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/tab_b.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/tab_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter28/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter28/html/tab_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter29/list2901.cpp: -------------------------------------------------------------------------------- 1 | // Listing 29-1. Defining a Custom rational Type 2 | /// Represent a rational number. 3 | struct rational 4 | { 5 | int numerator; ///< numerator gets the sign of the rational value 6 | int denominator; ///< denominator is always positive 7 | }; 8 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter29/list2902.cpp: -------------------------------------------------------------------------------- 1 | // Listing 29-2. Using a Custom Type and Its Members 2 | #include 3 | 4 | /// Represent a rational number. 5 | struct rational 6 | { 7 | int numerator; ///< numerator gets the sign of the rational value 8 | int denominator; ///< denominator is always positive 9 | }; 10 | 11 | int main() 12 | { 13 | rational pi{}; 14 | pi.numerator = 355; 15 | pi.denominator = 113; 16 | std::cout << "pi is approximately " << pi.numerator << "/" << pi.denominator << '\n'; 17 | } 18 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter29/list2906.cpp: -------------------------------------------------------------------------------- 1 | // Listing 29-6. Modifying the reduce Member Function to Accept a Negative Denominator 2 | /// Reduce the numerator and denominator by their GCD. 3 | void reduce() 4 | { 5 | assert(denominator != 0); 6 | if (denominator < 0) 7 | { 8 | denominator = -denominator; 9 | numerator = -numerator; 10 | } 11 | int div{gcd(numerator, denominator)}; 12 | numerator = numerator / div; 13 | denominator = denominator / div; 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter30/list3002.cpp: -------------------------------------------------------------------------------- 1 | // Listing 30-2. Using inline for Trivial Functions 2 | /// Compare two rational numbers for equality. 3 | /// @pre @p a and @p b are reduced to normal form 4 | bool operator==(rational const& a, rational const& b) 5 | { 6 | return a.numerator == b.numerator and a.denominator == b.denominator; 7 | } 8 | 9 | /// Compare two rational numbers for inequality. 10 | /// @pre @p a and @p b are reduced to normal form 11 | inline bool operator!=(rational const& a, rational const& b) 12 | { 13 | return not (a == b); 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter30/list3003.cpp: -------------------------------------------------------------------------------- 1 | // Listing 30-3. Implementing the < Operator for rational 2 | /// Compare two rational numbers for less-than. 3 | bool operator<(rational const& a, rational const& b) 4 | { 5 | return a.numerator * b.denominator < b.numerator * a.denominator; 6 | } 7 | 8 | /// Compare two rational numbers for less-than-or-equal. 9 | inline bool operator<=(rational const& a, rational const& b) 10 | { 11 | return not (b < a); 12 | } 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter30/list3004.cpp: -------------------------------------------------------------------------------- 1 | // Listing 30-4. Implementing the > and >= Operators in Terms of < 2 | /// Compare two rational numbers for greater-than. 3 | inline bool operator>(rational const& a, rational const& b) 4 | { 5 | return b < a; 6 | } 7 | 8 | /// Compare two rational numbers for greater-than-or-equal. 9 | inline bool operator>=(rational const& a, rational const& b) 10 | { 11 | return not (b > a); 12 | } 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter30/list3006.cpp: -------------------------------------------------------------------------------- 1 | // Listing 30-6. Addition Operator for the rational Type 2 | rational operator+(rational const& lhs, rational const& rhs) 3 | { 4 | return rational{lhs.numerator * rhs.denominator + rhs.numerator * lhs.denominator, 5 | lhs.denominator * rhs.denominator}; 6 | } 7 | 8 | rational operator-(rational const& r) 9 | { 10 | return rational{-r.numerator, r.denominator}; 11 | } 12 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter30/list3010.cpp: -------------------------------------------------------------------------------- 1 | // Listing 30-10. Optimizing Operators for a Specific Operand Type 2 | rational operator*(rational const& rat, int mult) 3 | { 4 | return rational{rat.numerator * mult, rat.denominator}; 5 | } 6 | 7 | inline rational operator*(int mult, rational const& rat) 8 | { 9 | return rat * mult; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter30/list3011.cpp: -------------------------------------------------------------------------------- 1 | // Listing 30-11. Computing the Absolute Value of a Rational Number 2 | rational absval(rational const& r) 3 | { 4 | return rational{std::abs(r.numerator), r.denominator}; 5 | } 6 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter31/list3102.cpp: -------------------------------------------------------------------------------- 1 | // Listing 31-2. Output Operator 2 | #include // declares the necessary << operators 3 | #include // declares the std::ostringstream type 4 | 5 | std::ostream& operator<<(std::ostream& out, rational const& rat) 6 | { 7 | std::ostringstream tmp{}; 8 | tmp << rat.numerator; 9 | if (rat.denominator != 1) 10 | tmp << '/' << rat.denominator; 11 | out << tmp.str(); 12 | 13 | return out; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter32/list3201.cpp: -------------------------------------------------------------------------------- 1 | // Listing 32-1. First Version of the Assignment Operator 2 | struct rational 3 | { 4 | rational(int num, int den) 5 | : numerator{num}, denominator{den} 6 | { 7 | reduce(); 8 | } 9 | 10 | rational& operator=(rational const& rhs) 11 | { 12 | numerator = rhs.numerator; 13 | denominator = rhs.denominator; 14 | reduce(); 15 | return *this; 16 | } 17 | int numerator; 18 | int denominator; 19 | }; 20 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter32/list3202.cpp: -------------------------------------------------------------------------------- 1 | // Listing 32-2. Assignment Operator with Explicit Use of this-> 2 | rational& operator=(rational const& that) 3 | { 4 | this->numerator = that.numerator; 5 | this->denominator = that.denominator; 6 | reduce(); 7 | return *this; 8 | } 9 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter32/list3203.cpp: -------------------------------------------------------------------------------- 1 | // Listing 32-3. Assignment of an Integer to a rational 2 | rational& operator=(int num) 3 | { 4 | this->numerator = num; 5 | this->denominator = 1; // no need to call reduce() 6 | return *this; 7 | } 8 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter32/list3204.cpp: -------------------------------------------------------------------------------- 1 | // Listing 32-4. Overloaded Constructors for rational 2 | rational() 3 | : numerator{0}, denominator{1} 4 | {} 5 | 6 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter33/list3301.cpp: -------------------------------------------------------------------------------- 1 | // Listing 33-1. Class Definition for a Cartesian Point 2 | struct point 3 | { 4 | double x; 5 | double y; 6 | }; 7 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter33/list3302.cpp: -------------------------------------------------------------------------------- 1 | // Listing 33-2. Multiple Data Members in One Declaration 2 | struct point 3 | { 4 | double x, y; 5 | }; 6 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter33/list3303.cpp: -------------------------------------------------------------------------------- 1 | // Listing 33-3. Using a Class and Its Members 2 | #include 3 | 4 | struct point 5 | { 6 | double x; 7 | double y; 8 | }; 9 | 10 | int main() 11 | { 12 | point origin{}, unity{}; 13 | origin.x = 0; 14 | origin.y = 0; 15 | unity.x = 1; 16 | unity.y = 1; 17 | std::cout << "origin = (" << origin.x << ", " << origin.y << ")\n"; 18 | std::cout << "unity = (" << unity.x << ", " << unity.y << ")\n"; 19 | } 20 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter33/list3305.cpp: -------------------------------------------------------------------------------- 1 | // Listing 33-5. Constructors for Class point 2 | struct point 3 | { 4 | point() 5 | : point{0.0, 0.0} 6 | {} 7 | point(double x, double y) 8 | : x_{x}, y_{y} 9 | {} 10 | point(point const& pt) 11 | : point{pt.x_, pt.y_} 12 | {} 13 | double x_; 14 | double y_; 15 | }; 16 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter34/list3402.cpp: -------------------------------------------------------------------------------- 1 | // Listing 34-2. Adding the const Modifier to print 2 | /// Print this record to @p out. 3 | void print(std::ostream& out, int threshold) 4 | const 5 | { 6 | out << std::setw(6) << height_ 7 | << std::setw(7) << weight_ 8 | << std::setw(3) << sex_ 9 | << std::setw(6) << bmi_; 10 | if (bmi_ >= threshold) 11 | out << '*'; 12 | else 13 | out << ' '; 14 | out << ' ' << name_ << '\n'; 15 | } 16 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter37/list3702.cpp: -------------------------------------------------------------------------------- 1 | // Listing 37-2. Printing Messages from Constructors to Illustrate Order of Construction 2 | #include 3 | 4 | class base 5 | { 6 | public: 7 | base() { std::cout << "base\n"; } 8 | }; 9 | 10 | class middle : public base 11 | { 12 | public: 13 | middle() { std::cout << "middle\n"; } 14 | }; 15 | 16 | class derived : public middle 17 | { 18 | public: 19 | derived() { std::cout << "derived\n"; } 20 | }; 21 | 22 | int main() 23 | { 24 | derived d; 25 | } 26 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter37/list3705.cpp: -------------------------------------------------------------------------------- 1 | // Listing 37-5. Accidentally Inheriting Privately 2 | class base 3 | { 4 | public: 5 | base(int v) : value_{v} {} 6 | int value() const { return value_; } 7 | private: 8 | int value_; 9 | }; 10 | 11 | class derived : base 12 | { 13 | public: 14 | derived() : base{42} {} 15 | }; 16 | 17 | int main() 18 | { 19 | base b{42}; 20 | int x{b.value()}; 21 | derived d{}; 22 | int y{d.value()}; 23 | } 24 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter38/list3803.cpp: -------------------------------------------------------------------------------- 1 | // Listing 38-3. Output Operator for Class work 2 | std::ostream& operator<<(std::ostream& out, work const& w) 3 | { 4 | w.print(out); 5 | return out; 6 | } 7 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter38/list3804.cpp: -------------------------------------------------------------------------------- 1 | // Listing 38-4. Adding a Class movie 2 | class movie : public work 3 | { 4 | public: 5 | movie() : work{}, runtime_{0} {} 6 | movie(movie const&) = default; 7 | movie(std::string const& id, std::string const& title, int runtime) 8 | : work{id, title}, runtime_{runtime} 9 | {} 10 | int runtime() const { return runtime_; } 11 | private: 12 | int runtime_; ///< running length in minutes 13 | }; 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter38/list3807.cpp: -------------------------------------------------------------------------------- 1 | // Listing 38-7. Defining work As an Abstract Class 2 | class work 3 | { 4 | public: 5 | work() = default; 6 | work(work const&) = default; 7 | work(std::string const& id, std::string const& title) : id_(id), title_(title) {} 8 | virtual ~work() {} 9 | std::string const& id() const { return id_; } 10 | std::string const& title() const { return title_; } 11 | virtual void print(std::ostream& out) const = 0; 12 | private: 13 | std::string id_; 14 | std::string title_; 15 | }; 16 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter39/list3901.cpp: -------------------------------------------------------------------------------- 1 | // Listing 39-1. Computing BMI 2 | #include 3 | 4 | typedef int height; 5 | typedef int weight; 6 | typedef int bmi; 7 | 8 | bmi compute_bmi(height h, weight w) 9 | { 10 | return w * 10000 / (h * h); 11 | } 12 | 13 | int main() 14 | { 15 | std::cout << "Height in centimeters: "; 16 | height h{}; 17 | std::cin >> h; 18 | 19 | std::cout << "Weight in kilograms: "; 20 | weight w{}; 21 | std::cin >> w; 22 | 23 | std::cout << "Body-mass index = " << compute_bmi(w, h) << '\n'; 24 | } 25 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter39/list3903.cpp: -------------------------------------------------------------------------------- 1 | // Listing 39-3. Copying vs. Moving 2 | #include 3 | #include 4 | #include 5 | 6 | void print(std::vector const& vector) 7 | { 8 | std::cout << "{ "; 9 | for (int i : vector) 10 | std::cout << i << ' '; 11 | std::cout << "}\n"; 12 | } 13 | 14 | int main() 15 | { 16 | std::vector source{1, 2, 3 }; 17 | print(source); 18 | std::vector copy{source}; 19 | print(copy); 20 | std::vector move{std::move(source)}; 21 | print(move); 22 | print(source); 23 | } 24 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter40/list4003.cpp: -------------------------------------------------------------------------------- 1 | // Listing 40-3. Declaring and Using References 2 | #include 3 | 4 | int main() 5 | { 6 | int answer{42}; // definition of a named object, also an lvalue 7 | int& ref{answer}; // declaration of a reference named ref 8 | ref = 10; // changes the value of answer 9 | std::cout << answer << '\n'; 10 | int const& cent{ref * 10}; // declaration; must be const to initialize with expr 11 | std::cout << cent << '\n'; 12 | } 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter40/list4005.cpp: -------------------------------------------------------------------------------- 1 | // Listing 40-5. Generating Unique Identification Numbers 2 | int generate_id() 3 | { 4 | static int counter{0}; 5 | ++counter; 6 | return counter; 7 | } 8 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter40/list4006.cpp: -------------------------------------------------------------------------------- 1 | // Listing 40-6. Calling generate_id to Demonstrate Static Variables 2 | #include 3 | 4 | int generate_id() 5 | { 6 | static int counter{0}; 7 | ++counter; 8 | return counter; 9 | } 10 | 11 | int main() 12 | { 13 | for (int i{0}; i != 10; ++i) 14 | std::cout << generate_id() << '\n'; 15 | } 16 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter40/list4007.cpp: -------------------------------------------------------------------------------- 1 | // Listing 40-7. Declaring counter Outside of the generate_id Function 2 | #include 3 | 4 | int counter; 5 | 6 | int generate_id() 7 | { 8 | ++counter; 9 | return counter; 10 | } 11 | 12 | int main() 13 | { 14 | for (int i{0}; i != 10; ++i) 15 | std::cout << generate_id() << '\n'; 16 | } 17 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter41/generate_id.hpp: -------------------------------------------------------------------------------- 1 | // Listing 41-5. The #include File for the generate_id Class 2 | /// Class for generating a unique ID number. 3 | class generate_id 4 | { 5 | public: 6 | generate_id() : counter_{0} {} 7 | long next(); 8 | private: 9 | short counter_; 10 | static short prefix_; 11 | static short const max_counter_{32767}; 12 | }; 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter41/list4102.cpp: -------------------------------------------------------------------------------- 1 | // Listing 41-2. The main Function for the ID-generating Program in the main.cpp File 2 | #include 3 | 4 | class generate_id 5 | { 6 | public: 7 | generate_id() : counter_{0} {} 8 | long next(); 9 | private: 10 | short counter_; 11 | static short prefix_; 12 | static short const max_counter_{32767}; 13 | }; 14 | 15 | int main() 16 | { 17 | generate_id gen{}; // Create an ID generator 18 | for (int i{0}; i != 10; ++i) 19 | std::cout << gen.next() << '\n'; 20 | } 21 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter41/list4103.cpp: -------------------------------------------------------------------------------- 1 | // Listing 41-3. Renaming a Member Function Only in main.cpp 2 | #include 3 | 4 | class generate_id 5 | { 6 | public: 7 | generate_id() : counter_{0} {} 8 | long next_id(); 9 | private: 10 | short counter_; 11 | static short prefix_; 12 | static short const max_counter_{32767}; 13 | }; 14 | 15 | int main() 16 | { 17 | generate_id gen{}; // Create an ID generator 18 | for (int i{0}; i != 10; ++i) 19 | std::cout << gen.next_id() << '\n'; 20 | } 21 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter41/list4104.cpp: -------------------------------------------------------------------------------- 1 | // Listing 41-4. Adding a New Data Member Only in main.cpp 2 | #include 3 | #include 4 | 5 | class generate_id 6 | { 7 | public: 8 | generate_id() : counter_{0} {} 9 | long next(); 10 | private: 11 | int unused_; 12 | short counter_; 13 | static short prefix_; 14 | static short const max_counter_{32767}; 15 | }; 16 | 17 | int main() 18 | { 19 | generate_id gen{}; // Create an ID generator 20 | for (int i{0}; i != 10; ++i) 21 | std::cout << gen.next() << '\n'; 22 | } 23 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter41/list4105.hpp: -------------------------------------------------------------------------------- 1 | // Listing 41-5. The #include File for the generate_id Class 2 | /// Class for generating a unique ID number. 3 | class generate_id 4 | { 5 | public: 6 | generate_id() : counter_{0} {} 7 | long next(); 8 | private: 9 | short counter_; 10 | static short prefix_; 11 | static short const max_counter_{32767}; 12 | }; 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter41/list4106.cpp: -------------------------------------------------------------------------------- 1 | // Listing 41-6. Rewrite of generate_id.cpp to #include the generate_id.hpp File 2 | #include "generate_id.hpp" 3 | 4 | // Switch to random-number as the initial prefix for production code. 5 | // short generate_id::prefix_{static_cast(std::rand())}; 6 | short generate_id::prefix_{1}; 7 | short const generate_id::max_counter_; 8 | 9 | long generate_id::next() 10 | { 11 | if (counter_ == max_counter_) 12 | counter_ = 0; 13 | else 14 | ++counter_; 15 | return prefix_ * (max_counter_ + 1) + counter_; 16 | } 17 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter41/list4107.cpp: -------------------------------------------------------------------------------- 1 | // Listing 41-7. Rewriting main.cpp to #include the generate_id.hpp File 2 | #include 3 | 4 | #include "generate_id.hpp" 5 | 6 | int main() 7 | { 8 | generate_id gen{}; // Create an ID generator 9 | for (int i{0}; i != 10; ++i) 10 | std::cout << gen.next() << '\n'; 11 | } 12 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter41/list4111.hpp: -------------------------------------------------------------------------------- 1 | // Listing 41-11. Simple Header for Math Constants 2 | #ifndef MATH_HPP_ 3 | #define MATH_HPP_ 4 | 5 | extern double pi; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter41/list4112.cpp: -------------------------------------------------------------------------------- 1 | // Listing 41-12. Definitions of Math Constants 2 | #include "math.hpp" 3 | 4 | // More digits that typical implementations of double support. 5 | double pi{3.14159265358979323846264338327}; 6 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter41/list4113.hpp: -------------------------------------------------------------------------------- 1 | // Listing 41-13. The Original point.hpp File 2 | #ifndef POINT_HPP_ 3 | #define POINT_HPP_ 4 | class point 5 | { 6 | public: 7 | point() : point{0, 0} {} 8 | point(int x, int y) : x_{x}, y_{y} {} 9 | int x() const { return x_; } 10 | int y() const { return y_; } 11 | private: 12 | int y_, x_; 13 | }; 14 | #endif // POINT_HPP_ 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter41/math.hpp: -------------------------------------------------------------------------------- 1 | // Listing 41-11. Simple Header for Math Constants 2 | #ifndef MATH_HPP_ 3 | #define MATH_HPP_ 4 | 5 | extern double pi; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter41/point.hpp: -------------------------------------------------------------------------------- 1 | // Listing 41-13. The Original point.hpp File 2 | #ifndef POINT_HPP_ 3 | #define POINT_HPP_ 4 | class point 5 | { 6 | public: 7 | point() : point{0, 0} {} 8 | point(int x, int y) : x_{x}, y_{y} {} 9 | int x() const { return x_; } 10 | int y() const { return y_; } 11 | private: 12 | int y_, x_; 13 | }; 14 | #endif // POINT_HPP_ 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter42/generate_id.hpp: -------------------------------------------------------------------------------- 1 | // Listing 42-1. Rewriting generate_id to Use the Function Call Operator 2 | #ifndef GENERATE_ID_HPP_ 3 | #define GENERATE_ID_HPP_ 4 | 5 | /// Class for generating a unique ID number. 6 | class generate_id 7 | { 8 | public: 9 | generate_id() : counter_{0} {} 10 | long operator()(); 11 | private: 12 | short counter_; 13 | static short prefix_; 14 | static short const max_counter_{32767}; 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter42/list4201.hpp: -------------------------------------------------------------------------------- 1 | // Listing 42-1. Rewriting generate_id to Use the Function Call Operator 2 | #ifndef GENERATE_ID_HPP_ 3 | #define GENERATE_ID_HPP_ 4 | 5 | /// Class for generating a unique ID number. 6 | class generate_id 7 | { 8 | public: 9 | generate_id() : counter_{0} {} 10 | long operator()(); 11 | private: 12 | short counter_; 13 | static short prefix_; 14 | static short const max_counter_{32767}; 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter42/list4202.cpp: -------------------------------------------------------------------------------- 1 | // Listing 42-2. Implementation of the generate_id Function Call Operator 2 | #include "generate_id.hpp" 3 | 4 | short generate_id::prefix_{1}; 5 | 6 | long generate_id::operator()() 7 | { 8 | if (counter_ == max_counter_) 9 | counter_ = 0; 10 | else 11 | ++counter_; 12 | return static_cast(prefix_) * (max_counter_ + 1) + counter_; 13 | } 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter42/list4204.cpp: -------------------------------------------------------------------------------- 1 | // Listing 42-4. The Main Program for Generating Successive Integers 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::vector vec(10); 8 | int state; 9 | std::generate(vec.begin(), vec.end(), [&state]() { return ++state; }); 10 | } 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter43/list4301.cpp: -------------------------------------------------------------------------------- 1 | // Listing 43-1. Searching for an Integer 2 | #include 3 | #include 4 | 5 | #include "data.hpp" 6 | 7 | int main() 8 | { 9 | intvector data{}; 10 | read_data(data); 11 | write_data(data); 12 | auto iter(std::find(data.begin(), data.end(), 42)); 13 | if (iter == data.end()) 14 | std::cout << "Value 42 not found\n"; 15 | else 16 | { 17 | *iter = 0; 18 | std::cout << "Value 42 changed to 0:\n"; 19 | write_data(data); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter43/list4304.cpp: -------------------------------------------------------------------------------- 1 | // Listing 43-4. Using find_if and intrange to Find an Integer That Lies Within a Range 2 | #include 3 | #include 4 | 5 | #include "data.hpp" 6 | #include "intrange.hpp" 7 | 8 | int main() 9 | { 10 | intvector data{}; 11 | read_data(data); 12 | write_data(data); 13 | auto iter(std::find_if(data.begin(), data.end(), intrange{10, 20})); 14 | if (iter == data.end()) 15 | std::cout << "No values in [10,20] found\n"; 16 | else 17 | std::cout << "Value " << *iter << " in range [10,20].\n"; 18 | } 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter43/list4310.cpp: -------------------------------------------------------------------------------- 1 | // Listing 43-10. Using replace_if and intrange to Replace All Integers in [10, 20] with 0 2 | #include 3 | 4 | #include "data.hpp" 5 | #include "intrange.hpp" 6 | 7 | int main() 8 | { 9 | intvector data{}; 10 | read_data(data); 11 | write_data(data); 12 | std::replace_if(data.begin(), data.end(), intrange{10, 20}, 0); 13 | write_data(data); 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter43/list4311.cpp: -------------------------------------------------------------------------------- 1 | // Listing 43-11. Using replace_if and intrange to Replace All Integers in [10, 20] with 0 2 | #include 3 | 4 | #include "data.hpp" 5 | #include "intrange.hpp" 6 | 7 | int main() 8 | { 9 | intvector data{}; 10 | read_data(data); 11 | write_data(data); 12 | std::replace_if(data.begin(), data.end(), 13 | [](int x) 14 | { 15 | return x >= 10 and x <= 20; 16 | }, 0); 17 | write_data(data); 18 | } 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter43/list4312.cpp: -------------------------------------------------------------------------------- 1 | // Listing 43-12. Shuffling Integers into Random Order 2 | #include 3 | 4 | #include "data.hpp" 5 | #include "sequence.hpp" 6 | 7 | int main() 8 | { 9 | intvector data(100); 10 | std::generate(data.begin(), data.end(), sequence{1, 1}); 11 | write_data(data); 12 | std::random_shuffle(data.begin(), data.end()); 13 | write_data(data); 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter44/list4403.cpp: -------------------------------------------------------------------------------- 1 | // Listing 44-3. Printing the Middle Item of a Series of Integers 2 | #include 3 | #include "data.hpp" 4 | 5 | int main() 6 | { 7 | intvector data{}; 8 | read_data(data); 9 | const intvec_iterator iter{data.begin()}; 10 | std::advance(iter, data.size() / 2); // move to middle of vector 11 | if (not data.empty()) 12 | std::cout << "middle item = " << *iter << '\n'; 13 | } 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter44/list4404.cpp: -------------------------------------------------------------------------------- 1 | // Listing 44-4. Really Printing the Middle Item of a Series of Integers 2 | #include 3 | 4 | #include "data.hpp" 5 | 6 | int main() 7 | { 8 | intvector data{}; 9 | read_data(data); 10 | intvector::const_iterator iter{data.begin()}; 11 | std::advance(iter, data.size() / 2); // move to middle of vector 12 | if (not data.empty()) 13 | std::cout << "middle item = " << *iter << '\n'; 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter44/list4405.cpp: -------------------------------------------------------------------------------- 1 | // Listing 44-5. Negating the Middle Value in a Series of Integers 2 | #include 3 | 4 | #include "data.hpp" 5 | 6 | int main() 7 | { 8 | intvector data{}; 9 | read_data(data); 10 | intvector::const_iterator iter{data.begin()}; 11 | std::advance(iter, data.size() / 2); // move to middle of vector 12 | if (not data.empty()) 13 | *iter = -*iter; 14 | write_data(data); 15 | } 16 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter45/list4501.cpp: -------------------------------------------------------------------------------- 1 | // Listing 45-1. Accessing an Element of a Vector 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::vector data{ 10, 20 }; 8 | data.at(5) = 0; 9 | std::cout << data.at(5) << '\n'; 10 | } 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter45/list4502.cpp: -------------------------------------------------------------------------------- 1 | // Listing 45-2. A Bad Way to Access an Element of a Vector 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | std::vector data{ 10, 20 }; 8 | data[5] = 0; 9 | std::cout << data[5] << '\n'; 10 | } 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter45/list4507.cpp: -------------------------------------------------------------------------------- 1 | // Listing 45-7. Checking for a Zero Denominator in reduce() 2 | void rational::reduce() 3 | { 4 | if (denominator_ == 0) 5 | throw zero_denominator{"denominator is zero"}; 6 | if (denominator_ < 0) 7 | { 8 | denominator_ = -denominator_; 9 | numerator_ = -numerator_; 10 | } 11 | int div{gcd(numerator_, denominator_)}; 12 | numerator_ = numerator_ / div; 13 | denominator_ = denominator_ / div; 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter45/list4508.cpp: -------------------------------------------------------------------------------- 1 | // Listing 45-8. Throwing an Exception from a noexcept Function 2 | #include 3 | #include 4 | 5 | void function() noexcept 6 | { 7 | throw std::exception{}; 8 | } 9 | 10 | int main() 11 | { 12 | try { 13 | function(); 14 | } catch (std::exception const& ex) { 15 | std::cout << "Gotcha!\n"; 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter46/list4605.cpp: -------------------------------------------------------------------------------- 1 | // Listing 46-5. Implementing the Multiplication Assignment Operator 2 | rational& rational::operator*=(rational const& rhs) 3 | { 4 | numerator_ *= rhs.numerator(); 5 | denominator_ *= rhs.denominator(); 6 | reduce(); 7 | return *this; 8 | } 9 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter46/list4606.cpp: -------------------------------------------------------------------------------- 1 | // Listing 46-6. Reimplementing Multiplication in Terms of an Assignment Operator 2 | rational operator*(rational const& lhs, rational const& rhs) 3 | { 4 | rational result{lhs}; 5 | result *= rhs; 6 | return result; 7 | } 8 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter46/list4608.cpp: -------------------------------------------------------------------------------- 1 | // Listing 46-8. The Prefix Increment Operator for rational 2 | rational& rational::operator++() 3 | { 4 | numerator_ += denominator_; 5 | return *this; 6 | } 7 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter46/list4609.cpp: -------------------------------------------------------------------------------- 1 | // Listing 46-9. Postfix Increment and Decrement Operators 2 | rational rational::operator++(int) 3 | { 4 | rational result{*this}; 5 | numerator_ += denominator_; 6 | return result; 7 | } 8 | 9 | rational rational::operator--(int) 10 | { 11 | rational result{*this}; 12 | numerator_ -= denominator_; 13 | return result; 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/Makefile: -------------------------------------------------------------------------------- 1 | DEBUG = -g -pg -fprofile-arcs -ftest-coverage 2 | CXXFLAGS = -ansi -pedantic -Wall -std=c++11 3 | TEST = test.cpp fixed.cpp 4 | TESTOBJ = $(TEST:.cpp=.o) 5 | 6 | all : runtest 7 | 8 | test : $(TESTOBJ) 9 | $(CXX) $(CXXFLAGS) -o $@ $(TESTOBJ) 10 | 11 | runtest : cleantest test 12 | ./test 13 | 14 | clean : cleantest 15 | $(RM) -r $(TESTOBJ) test html 16 | 17 | cleantest : 18 | $(RM) *.{gcov,gcda} 19 | 20 | test.o : test.cpp fixed.hpp 21 | fixed.o : fixed.cpp fixed.hpp ioflags.hpp 22 | 23 | .PHONY : runtest clean cleantest 24 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/bc_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/bdwn.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/closed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/doxygen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2blank.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2cl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2cl.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2doc.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2folderclosed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2folderopen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2lastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2lastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2link.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2mlastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2mlastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2mnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2mnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2mo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2mo.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2node.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2ns.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2plastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2plastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2pnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2pnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2splitbar.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/ftv2vertline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/ftv2vertline.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/nav_f.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/nav_g.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/nav_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/open.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/sync_off.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/sync_on.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/tab_a.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/tab_b.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/tab_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter47/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter47/html/tab_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter48/gcd.hpp: -------------------------------------------------------------------------------- 1 | // Listing 48-9. The gcd Function Template 2 | #ifndef GCD_HPP_ 3 | #define GCD_HPP_ 4 | 5 | #include // for std::abs 6 | 7 | template 8 | /// Compute the greatest common divisor of two integers, using Euclid's algorithm. 9 | T gcd(T n, T m) 10 | { 11 | n = std::abs(n); 12 | while (m != 0) { 13 | T tmp{n % m}; 14 | n = m; 15 | m = tmp; 16 | } 17 | return n; 18 | } 19 | #endif 20 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter48/list4801.cpp: -------------------------------------------------------------------------------- 1 | // Listing 48-1. Writing an Absolute Value Function 2 | T absval(T x) 3 | { 4 | if (x < 0) 5 | return -x; 6 | else 7 | return x; 8 | } 9 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter48/list4802.cpp: -------------------------------------------------------------------------------- 1 | // Listing 48-2. Writing a Function Template 2 | template 3 | T absval(T x) 4 | { 5 | if (x < 0) 6 | return -x; 7 | else 8 | return x; 9 | } 10 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter48/list4804.cpp: -------------------------------------------------------------------------------- 1 | // Listing 48-4. Mystery Function Template 2 | template 3 | T add(T lhs, T rhs) 4 | { 5 | return lhs(rhs); 6 | } 7 | 8 | int main() 9 | { 10 | } 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter48/list4805.cpp: -------------------------------------------------------------------------------- 1 | // Listing 48-5. One Way to Implement the copy Algorithm 2 | template 3 | OutputIterator copy(InputIterator start, InputIterator end, OutputIterator result) 4 | { 5 | for ( ; start != end; ++start, ++result) 6 | *result = *start; 7 | return result; 8 | } 9 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter48/list4806.cpp: -------------------------------------------------------------------------------- 1 | // Listing 48-6. Implementing the find Algorithm 2 | template 3 | InputIterator find(InputIterator start, InputIterator end, T value) 4 | { 5 | for ( ; start != end; ++start) 6 | if (*start == value) 7 | return start; 8 | return end; 9 | } 10 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter48/list4807.cpp: -------------------------------------------------------------------------------- 1 | // Listing 48-7. The std::min Algorithm 2 | template 3 | T min(T a, T b) 4 | { 5 | if (a < b) 6 | return a; 7 | else if (b < a) 8 | return b; 9 | else 10 | return a; // a and b are equivalent, so return a 11 | } 12 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter48/list4808.cpp: -------------------------------------------------------------------------------- 1 | // Listing 48-8. Multiple Template Arguments 2 | #include 3 | 4 | template 5 | U input_sum(std::istream& in) 6 | { 7 | T x{}; 8 | U sum{0}; 9 | while (in >> x) 10 | sum += x; 11 | return sum; 12 | } 13 | 14 | int main() 15 | { 16 | long sum{input_sum(std::cin)}; 17 | std::cout << sum << '\n'; 18 | } 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter48/list4809.hpp: -------------------------------------------------------------------------------- 1 | // Listing 48-9. The gcd Function Template 2 | #ifndef GCD_HPP_ 3 | #define GCD_HPP_ 4 | 5 | #include // for std::abs 6 | 7 | template 8 | /// Compute the greatest common divisor of two integers, using Euclid's algorithm. 9 | T gcd(T n, T m) 10 | { 11 | n = std::abs(n); 12 | while (m != 0) { 13 | T tmp{n % m}; 14 | n = m; 15 | m = tmp; 16 | } 17 | return n; 18 | } 19 | #endif 20 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter49/list4901.cpp: -------------------------------------------------------------------------------- 1 | // Listing 49-1. The point Class Template 2 | template 3 | class point { 4 | public: 5 | point(T x, T y) : x_{x}, y_{y} {} 6 | T x() const { return x_; } 7 | T y() const { return y_; } 8 | void move_to(T x, T y); ///< Move to absolute coordinates (x, y) 9 | void move_by(T x, T y); ///< Add (x, y) to current position 10 | private: 11 | T x_, y_; 12 | }; 13 | 14 | template 15 | void point::move_to(T x, T y) 16 | { 17 | x_ = x; 18 | y_ = y; 19 | } 20 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter49/list4902.cpp: -------------------------------------------------------------------------------- 1 | // Listing 49-2. The move_by Member Function 2 | template 3 | void point::move_by(T x, T y) 4 | { 5 | x_ += x; 6 | y_ += y; 7 | } 8 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter49/list4905.cpp: -------------------------------------------------------------------------------- 1 | // Listing 49-5. Testing rational Comparison Operator 2 | #include 3 | #include "rational.hpp" 4 | 5 | int main() 6 | { 7 | rational r{}; 8 | while (std::cin >> r) 9 | if (r != 0) 10 | std::cout << r << '\n'; 11 | } 12 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter49/list4906.cpp: -------------------------------------------------------------------------------- 1 | // Listing 49-6. Invoking a Default Constructor of a Template Parameter 2 | template 3 | rational& rational::operator/=(rational const& rhs) 4 | { 5 | if (rhs.numerator() == T{}) 6 | throw zero_denominator("divide by zero"); 7 | numerator_ *= rhs.denominator(); 8 | denominator_ *= rhs.numerator(); 9 | if (denominator_ < T{}) 10 | { 11 | denominator_ = -denominator_; 12 | numerator_ = -numerator_; 13 | } 14 | reduce(); 15 | return *this; 16 | } 17 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter49/list4907.cpp: -------------------------------------------------------------------------------- 1 | // Listing 49-7. Trying to Mix rational Base Types 2 | #include "rational.hpp" 3 | 4 | int main() 5 | { 6 | rational little{}; 7 | rational big{}; 8 | big = little; 9 | } 10 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter49/list4908.cpp: -------------------------------------------------------------------------------- 1 | // Listing 49-8. Defining the Assignment Operator Function Template 2 | template 3 | template 4 | rational& rational::operator=(rational const& rhs) 5 | { 6 | assign(rhs.numerator(), rhs.denominator()); 7 | return *this; 8 | } 9 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter49/list4909.cpp: -------------------------------------------------------------------------------- 1 | // Listing 49-9. Defining a Member Constructor Template 2 | template 3 | template 4 | rational::rational(rational const& copy) 5 | : numerator_{copy.numerator()}, denominator_{copy.denominator()} 6 | {} 7 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter50/list5001.cpp: -------------------------------------------------------------------------------- 1 | // Listing 50-1. The point Class Template 2 | template 3 | class point 4 | { 5 | public: 6 | typedef T value_type; 7 | point(T const& x, T const& y) : x_{x}, y_{y} {} 8 | point() : point{T{}, T{}} {} 9 | T const& x() const { return x_; } 10 | T const& y() const { return y_; } 11 | void move_absolute(T const& x, T const& y) { 12 | x_ = x; 13 | y_ = y; 14 | } 15 | void move_relative(T const& dx, T const& dy) { 16 | x_ += dx; 17 | y_ += dy; 18 | } 19 | private: 20 | T x_; 21 | T y_; 22 | }; 23 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter50/list5002.cpp: -------------------------------------------------------------------------------- 1 | // Listing 50-2. The point Specialization 2 | template<> 3 | class point 4 | { 5 | public: 6 | typedef int value_type; 7 | point(int x, int y) : x_{x}, y_{y} {} 8 | point() : point{0, 0} {} 9 | int x() const { return x_; } 10 | int y() const { return y_; } 11 | void move_absolute(int x, int y) { 12 | x_ = x; 13 | y_ = y; 14 | } 15 | void move_relative(int dx, int dy) { 16 | x_ += dx; 17 | y_ += dy; 18 | } 19 | private: 20 | int x_; 21 | int y_; 22 | }; 23 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter50/list5005.cpp: -------------------------------------------------------------------------------- 1 | // Listing 50-5. The Primary std::less Class Template 2 | template 3 | struct less 4 | { 5 | bool operator()(T const& a, T const& b) const { return a < b; } 6 | }; 7 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter51/list5101.cpp: -------------------------------------------------------------------------------- 1 | // Listing 51-1. The std::pair Class Template 2 | template 3 | struct pair 4 | { 5 | typedef T first_type; 6 | typedef U second_type; 7 | T first; 8 | U second; 9 | pair(); 10 | pair(T const& first, U const& second); 11 | template 12 | pair(pair const& other); 13 | }; 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter51/list5102.cpp: -------------------------------------------------------------------------------- 1 | // Listing 51-2. Specializing pair<> for Two void Arguments 2 | template<> 3 | struct pair 4 | { 5 | typedef void first_type; 6 | typedef void second_type; 7 | pair(pair const&) = default; 8 | pair() = default; 9 | pair& operator=(pair const&) = default; 10 | }; 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter51/list5103.cpp: -------------------------------------------------------------------------------- 1 | // Listing 51-3. Specializing pair for One void Argument 2 | template 3 | struct pair 4 | { 5 | typedef void first_type; 6 | typedef U second_type; 7 | U second; 8 | pair() = default; 9 | pair(pair const&) = default; 10 | pair(U const& second); 11 | template 12 | pair(pair const& other); 13 | }; 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter51/list5104.cpp: -------------------------------------------------------------------------------- 1 | // Listing 51-4. Specializing pair for the Other void Argument 2 | template 3 | struct pair 4 | { 5 | typedef T first_type; 6 | typedef void second_type; 7 | T first; 8 | pair() = default; 9 | pair(pair const&) = default; 10 | pair(T const& first); 11 | template 12 | pair(pair const& other); 13 | }; 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter51/list5106.cpp: -------------------------------------------------------------------------------- 1 | // Listing 51-6. Computing a Power of 10 at Compile Time 2 | /// Called from power10 to compute 10@p n, storing the result so far in @p result. 3 | int constexpr power10_helper(int n, int result) 4 | { 5 | return n == 0 ? result : power10_helper(n - 1, 10 * result); 6 | } 7 | 8 | /// Compute a power of 10 at compile time. The type T must support subtraction and multiplication. 9 | int constexpr power10(int n) 10 | { 11 | return power10_helper(n, 1); 12 | } 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter52/list5201.cpp: -------------------------------------------------------------------------------- 1 | // Listing 52-1. Defining the rational Class Template in the numeric Namespace 2 | #ifndef RATIONAL_HPP_ 3 | #define RATIONAL_HPP_ 4 | 5 | namespace numeric 6 | { 7 | template 8 | class rational 9 | { 10 | ... you know what goes here... 11 | }; 12 | template 13 | bool operator==(rational const& a, rational const& b); 14 | template 15 | rational operator+(rational const& a, rational const& b); 16 | ... and so on... 17 | } // namespace numeric 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter52/list5202.cpp: -------------------------------------------------------------------------------- 1 | // Listing 52-2. Defining the fixed Class Template in the numeric Namespace 2 | #ifndef FIXED_HPP_ 3 | #define FIXED_HPP_ 4 | 5 | namespace numeric 6 | { 7 | template 8 | class fixed 9 | { 10 | ... copied from Exploration 51... 11 | }; 12 | template 13 | bool operator==(fixed const& a, fixed const& b); 14 | template 15 | fixed operator+(fixed const& a, fixed const& b); 16 | // and so on... 17 | } // namespace numeric 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter52/list5203.cpp: -------------------------------------------------------------------------------- 1 | // Listing 52-3. Defining Entities in a Namespace 2 | namespace numeric 3 | { 4 | template 5 | rational operator+(rational const& a, rational const& b) 6 | { 7 | rational result{a}; 8 | result += b; 9 | return result; 10 | } 11 | } 12 | 13 | template 14 | numeric::fixed numeric::operator+(fixed const& a, fixed const& b) 15 | { 16 | fixed result{a}; 17 | result += b; 18 | return result; 19 | } 20 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter52/list5204.cpp: -------------------------------------------------------------------------------- 1 | // Listing 52-4. Alternative Style of Function Declaration in a Namespace 2 | template 3 | auto numeric::operator+(fixed const& a, fixed const& b) -> fixed 4 | { 5 | fixed result{a}; 6 | result += b; 7 | return result; 8 | } 9 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter52/list5208.cpp: -------------------------------------------------------------------------------- 1 | // Listing 52-8. Comparing a using Directive with a using Declaration 2 | #include 3 | 4 | void demonstrate_using_directive() 5 | { 6 | using namespace std; 7 | typedef int ostream; 8 | ostream x{0}; 9 | std::cout << x << '\n'; 10 | } 11 | 12 | void demonstrate_using_declaration() 13 | { 14 | using std::ostream; 15 | typedef int ostream; 16 | ostream x{0}; 17 | std::cout << x << '\n'; 18 | } 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter53/erase_less.hpp: -------------------------------------------------------------------------------- 1 | #ifndef ERASE_LESS_HPP_ 2 | #define ERASE_LESS_HPP_ 3 | 4 | // Listing 53-3. Erasing Elements from a Sequence Container 5 | template 6 | void erase_less(Container& cont) 7 | { 8 | typename Container::iterator prev{cont.end()}; 9 | typename Container::iterator iter{cont.begin()}; 10 | while (iter != cont.end()) 11 | { 12 | if (prev != cont.end() and not (*prev < *iter)) 13 | iter = cont.erase(iter); 14 | else 15 | { 16 | prev = iter; 17 | ++iter; 18 | } 19 | } 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter53/list5301.cpp: -------------------------------------------------------------------------------- 1 | // Listing 53-1. Specializing the hash Template for the rational Type 2 | #include 3 | #include "rational.hpp" 4 | namespace std { 5 | 6 | template 7 | class hash> 8 | { 9 | public: 10 | std::size_t operator()(rational const& r) 11 | const 12 | { 13 | return hasher_(r.numerator()) + hasher_(r.denominator()); 14 | } 15 | private: 16 | std::hash hasher_; 17 | }; 18 | } // end of std 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter53/list5302.cpp: -------------------------------------------------------------------------------- 1 | // Listing 53-2. Using a Hint Position When Inserting into a Set 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | std::set words{}; 9 | 10 | std::set::iterator hint{words.begin()}; 11 | std::string word{}; 12 | while(std::cin >> word) 13 | hint = words.emplace_hint(hint, std::move(word)); 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter53/list5303.hpp: -------------------------------------------------------------------------------- 1 | #ifndef ERASE_LESS_HPP_ 2 | #define ERASE_LESS_HPP_ 3 | 4 | // Listing 53-3. Erasing Elements from a Sequence Container 5 | template 6 | void erase_less(Container& cont) 7 | { 8 | typename Container::iterator prev{cont.end()}; 9 | typename Container::iterator iter{cont.begin()}; 10 | while (iter != cont.end()) 11 | { 12 | if (prev != cont.end() and not (*prev < *iter)) 13 | iter = cont.erase(iter); 14 | else 15 | { 16 | prev = iter; 17 | ++iter; 18 | } 19 | } 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter54/list5403.cpp: -------------------------------------------------------------------------------- 1 | // Listing 54-3. Result of Running the Program in Listing 54-2 2 | \xd7 is punctuation in en_US.iso88591 3 | \xd7 is alphanumeric in ru_RU.iso88595 4 | \xd7 is alphanumeric in el_GR.iso88597 5 | \xd7 is none of the above in he_IL.iso88598 6 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter55/list5503.cpp: -------------------------------------------------------------------------------- 1 | // Listing 55-3. The main Program for Testing is_palindrome 2 | int main() 3 | { 4 | std::locale::global(std::locale{""}); 5 | std::wcin.imbue(std::locale{}); 6 | std::wcout.imbue(std::locale{}); 7 | 8 | std::wstring line{}; 9 | while (std::getline(std::wcin, line)) 10 | if (is_palindrome(line)) 11 | std::wcout << line << L'\n'; 12 | } 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter56/debug.hpp: -------------------------------------------------------------------------------- 1 | // Listing 56-1. Header That Declares a Trivial Debugging Function 2 | #ifndef DEBUG_HPP_ 3 | #define DEBUG_HPP_ 4 | 5 | #include 6 | 7 | /** @brief Write a debug message to the file @c "debug.txt" 8 | * @param msg The message to write 9 | */ 10 | void debug(std::string const& msg); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter56/list5601.hpp: -------------------------------------------------------------------------------- 1 | // Listing 56-1. Header That Declares a Trivial Debugging Function 2 | #ifndef DEBUG_HPP_ 3 | #define DEBUG_HPP_ 4 | 5 | #include 6 | 7 | /** @brief Write a debug message to the file @c "debug.txt" 8 | * @param msg The message to write 9 | */ 10 | void debug(std::string const& msg); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter56/list5602.cpp: -------------------------------------------------------------------------------- 1 | // Listing 56-2. Implementing the Debug Function 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | #include "debug.hpp" 8 | 9 | void debug(std::string const& str) 10 | { 11 | std::ofstream stream{"debug.txt", std::ios_base::out | std::ios_base::app}; 12 | if (not stream) 13 | throw std::runtime_error("cannot open debug.txt"); 14 | stream.exceptions(std::ios_base::failbit); 15 | stream << str << '\n'; 16 | stream.close(); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter56/list5609.hpp: -------------------------------------------------------------------------------- 1 | // Listing 56-9. The from_string Function Extracts a Value from a String 2 | #include // for the >> operator 3 | #include // for istringstream 4 | #include // for string 5 | #include "conversion_error.hpp" 6 | 7 | template 8 | T from_string(std::string const& str) 9 | { 10 | std::istringstream in{str}; 11 | T result{}; 12 | if (in >> result) 13 | return result; 14 | else 15 | throw conversion_error{str}; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter56/list5611.hpp: -------------------------------------------------------------------------------- 1 | #ifndef TO_STRING_HPP_ 2 | #define TO_STRING_HPP_ 3 | 4 | // Listing 56-11. The to_string Function Converts a Value to a String 5 | #include // for the << operator 6 | #include // for ostringstream 7 | #include // for string 8 | 9 | template 10 | std::string to_string(T const& obj) 11 | { 12 | std::ostringstream out{}; 13 | out << obj; 14 | return out.str(); 15 | } 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter56/list5612.hpp: -------------------------------------------------------------------------------- 1 | // Listing 56-12. Rewriting to_string As a Template Function 2 | #include // for the << operator 3 | #include // for ostringstream 4 | #include // for basic_string 5 | 6 | template 7 | std::basic_string to_string(T const& obj) 8 | { 9 | std::basic_ostringstream out{}; 10 | out << obj; 11 | return out.str(); 12 | } 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter56/list5613.cpp: -------------------------------------------------------------------------------- 1 | // Listing 56-13. Demonstrating the Use of to_string 2 | #include 3 | #include "to_string.hpp" 4 | #include "from_string.hpp" 5 | 6 | int main() 7 | { 8 | std::string str{ 9 | to_string, std::allocator>(42) 10 | }; 11 | int value{from_string(str)}; 12 | } 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter56/list5615.hpp: -------------------------------------------------------------------------------- 1 | // Listing 56-15. Improving the Calling Interface of to_string 2 | #include // for the << operator 3 | #include // for ostringstream 4 | 5 | template 6 | String to_string(T const& obj) 7 | { 8 | std::basic_ostringstream out{}; 10 | out << obj; 11 | return out.str(); 12 | } 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter56/list5617.cpp: -------------------------------------------------------------------------------- 1 | // Listing 56-17. Calling to_string 2 | #include 3 | #include "to_string.hpp" 4 | 5 | int main() 6 | { 7 | std::cout << to_string(42, std::ios_base::hex) << '\n'; 8 | std::cout << to_string(42.0, std::ios_base::scientific, 10) << '\n'; 9 | std::cout << to_string(true, std::ios_base::boolalpha) << '\n'; 10 | } 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/Makefile: -------------------------------------------------------------------------------- 1 | DEBUG = -g3 -O0 -MMD 2 | CXXFLAGS = -ansi -pedantic -Wall -std=c++11 $(DEBUG) 3 | TEST = test.cpp 4 | TESTOBJ = $(TEST:.cpp=.o) 5 | 6 | all : runtest 7 | 8 | test : $(TESTOBJ) 9 | $(CXX) $(CXXFLAGS) -o $@ $(TESTOBJ) 10 | 11 | runtest : cleantest test 12 | ./test 13 | 14 | clean : cleantest 15 | $(RM) -r $(TESTOBJ) test html *.d 16 | 17 | cleantest : 18 | $(RM) *.{gcov,gcda} 19 | 20 | .PHONY : runtest clean cleantest 21 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/gcd.cpp: -------------------------------------------------------------------------------- 1 | #include "gcd.hpp" 2 | 3 | int gcd(int n, int m) 4 | { 5 | if (n < 0) 6 | n = -n; 7 | while (m != 0) { 8 | int tmp{n % m}; 9 | n = m; 10 | m = tmp; 11 | } 12 | return n; 13 | } 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/gcd.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GCD_HPP_ 2 | #define GCD_HPP_ 3 | 4 | /// Compute greatest-common-denominator. 5 | /// @param n 6 | /// @param m 7 | template 8 | T gcd(T n, T m) 9 | { 10 | static const T zero{}; 11 | if (n < zero) 12 | n = -n; 13 | while (m != zero) { 14 | T tmp{n % m}; 15 | n = m; 16 | m = tmp; 17 | } 18 | return n; 19 | } 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/bc_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/bdwn.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/classrational_1_1zero__denominator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/classrational_1_1zero__denominator.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/closed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/doxygen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2blank.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2cl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2cl.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2doc.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2folderclosed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2folderopen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2lastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2lastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2link.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2mlastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2mlastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2mnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2mnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2mo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2mo.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2node.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2ns.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2plastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2plastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2pnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2pnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2splitbar.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/ftv2vertline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/ftv2vertline.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/nav_f.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/nav_g.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/nav_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/open.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/sync_off.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/sync_on.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/tab_a.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/tab_b.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/tab_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter57/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter57/html/tab_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter60/list6004.cpp: -------------------------------------------------------------------------------- 1 | // Listing 60-4. Examining Expression Categories 2 | #include 3 | #include 4 | 5 | void print(std::string&& move) 6 | { 7 | std::cout << "move: " << std::move(move) << '\n'; 8 | } 9 | 10 | void print(std::string const& copy) 11 | { 12 | std::cout << "copy: " << copy << '\n'; 13 | } 14 | 15 | int main() 16 | { 17 | std::string a{"a"}, b{"b"}, c{"c"}; 18 | 19 | print(a); 20 | print(a + b); 21 | print(std::move(a)); 22 | print(std::move(a + b)); 23 | print(a + std::move(b)); 24 | print(a + b + c); 25 | } 26 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter62/list6201.cpp: -------------------------------------------------------------------------------- 1 | // Listing 62-1. Array Type in Function Parameters 2 | #include 3 | 4 | int sum(int* array, int size); 5 | 6 | int main() 7 | { 8 | int data[5]{ 1, 2, 3, 4, 5 }; 9 | std::cout << sum(data, 5) << '\n'; 10 | } 11 | 12 | int sum(int array[], int size) 13 | { 14 | int result{0}; 15 | while (size-- != 0) 16 | result += array[size]; 17 | return result; 18 | } 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter62/list6202.cpp: -------------------------------------------------------------------------------- 1 | // Listing 62-2. Deliberate Errors with new and delete 2 | #include 3 | 4 | int main() 5 | { 6 | int* p{ new int[10] }; 7 | delete p; 8 | p = new int; 9 | delete[] p; 10 | std::unique_ptr up{ new int[10] }; 11 | up.reset(); 12 | std::unique_ptr upa{ new int }; 13 | upa.reset(); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter62/list6203.cpp: -------------------------------------------------------------------------------- 1 | // Listing 62-3. Echoing Command-Line Arguments 2 | #include 3 | 4 | int main(int argc, char* argv[]) 5 | { 6 | char const* separator{""}; 7 | while (--argc != 0) 8 | { 9 | std::cout << separator << *++argv; 10 | separator = " "; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter62/list6205.cpp: -------------------------------------------------------------------------------- 1 | // Listing 62-5. Using Pointer Arithmetic to Determine the Length of a C String 2 | #include 3 | 4 | std::size_t my_std_strlen(char const* str) 5 | { 6 | char const* start{str}; // remember the start of the string 7 | while (*str != 0) // while not at the end of the string 8 | ++str; // advance to the next character 9 | return str - start; // compute string length by subtracting pointers 10 | } 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter63/list6302.cpp: -------------------------------------------------------------------------------- 1 | // Listing 63-2. Using Smart Pointers to Manage Artifacts 2 | std::map> artifacts; 3 | 4 | std::shared_ptr 5 | lookup_artifact(std::string const& name) 6 | { 7 | std::shared_ptr a{artifacts[name]}; 8 | if (a.get() == nullptr) 9 | { 10 | a = std::make_shared(name); 11 | artifacts[name] = a; 12 | } 13 | return a; 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter64/list6401.cpp: -------------------------------------------------------------------------------- 1 | // Listing 64-1. An Initial Definition of Formatting Flags 2 | typedef int fmtflags; 3 | fmtflags const showbase = 0x01; 4 | fmtflags const boolalpha = 0x02; 5 | fmtflags const skipws = 0x04; 6 | fmtflags const showpoint = 0x08; 7 | fmtflags const showpos = 0x10; 8 | // etc. for other flags... 9 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter64/list6402.cpp: -------------------------------------------------------------------------------- 1 | // Listing 64-2. A Simple Implementation of the setf Member Function 2 | void setf(fmtflags f) 3 | { 4 | flags_ = flags_ | f; 5 | } 6 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter64/list6403.cpp: -------------------------------------------------------------------------------- 1 | // Listing 64-3. A Simple Implementation of the unsetf Member Function 2 | void unsetf(fmtflags f) 3 | { 4 | flags_ = flags_ & ~f; 5 | } 6 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter64/list6404.cpp: -------------------------------------------------------------------------------- 1 | // Listing 64-4. Using Assignment Operators in the Flags Functions 2 | void setf(fmtflags f) 3 | { 4 | flags_ |= f; 5 | } 6 | 7 | void unsetf(fmtflags f) 8 | { 9 | flags_ &= ~f; 10 | } 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter64/list6405.cpp: -------------------------------------------------------------------------------- 1 | // Listing 64-5. Declarations for Formatting Fields 2 | fmtflags static constexpr adjustfield = 0x300; 3 | fmtflags static constexpr left = 0x000; 4 | fmtflags static constexpr right = 0x100; 5 | fmtflags static constexpr internal = 0x200; 6 | fmtflags static constexpr floatfield = 0xC00; 7 | fmtflags static constexpr scientific = 0x400; 8 | fmtflags static constexpr fixed = 0x800; 9 | fmtflags static constexpr hexfloat = 0xC00; 10 | // general does not have a name; its value is zero 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter64/list6406.cpp: -------------------------------------------------------------------------------- 1 | // Listing 64-6. Two-Argument Form of the setf Function 2 | void setf(fmtflags flags_to_set, fmtflags field) 3 | { 4 | flags_ &= ~field; 5 | flags_ |= flags_to_set; 6 | } 7 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter64/list6409.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // Listing 64-9. Mixing Signed and Unsigned Integers 4 | void show(unsigned u) 5 | { 6 | std::cout << u << '\n'; 7 | } 8 | 9 | int main() 10 | { 11 | int i{-1}; 12 | std::cout << i << '\n'; 13 | show(i); 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter65/list6503.cpp: -------------------------------------------------------------------------------- 1 | // Listing 65-3. Automatically Initializing the Language Data Structures 2 | class initializer { 3 | public: 4 | initializer() { initialize_language(); } 5 | }; 6 | initializer init; 7 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter66/assignment_mixin.hpp: -------------------------------------------------------------------------------- 1 | // Listing 66-8. The assignment_mixin Class Template 2 | template 3 | class assignment_mixin { 4 | public: 5 | T& operator=(T rhs) 6 | { 7 | rhs.swap(static_cast(*this)); 8 | return static_cast(*this); 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter66/list6603.cpp: -------------------------------------------------------------------------------- 1 | // Listing 66-3. The Hashable Interface in C++ 2 | class Hashable 3 | { 4 | public: 5 | virtual ~Hashable(); 6 | virtual unsigned long hash() const = 0; 7 | virtual bool equalTo(Hashable const&) const = 0; 8 | }; 9 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter66/list6604.cpp: -------------------------------------------------------------------------------- 1 | // Listing 66-4. The HashableString Class 2 | class HashableString : public Hashable 3 | { 4 | public: 5 | HashableString() : string_{} {} 6 | ~HashableString() override; 7 | unsigned long hash() const override; 8 | bool equalTo(Hashable const&) const override; 9 | 10 | // Implement the entire interface of std::string ... 11 | private: 12 | std::string string_; 13 | }; 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter66/list6607.cpp: -------------------------------------------------------------------------------- 1 | // Listing 66-7. Rewriting string_pool to Use hash<> 2 | #include 3 | #include 4 | #include 5 | #include "hash.hpp" // Listing 66-6 6 | 7 | #include "string_pool.hpp" // Copied from Listing 66-5 8 | 9 | 10 | int main() 11 | { 12 | string_pool pool{}; 13 | std::string str{}; 14 | hash hasher{}; 15 | while (std::cin >> str) 16 | { 17 | std::cout << "hash of \"" << str << "\" = " << hasher(str) << '\n'; 18 | pool.add(std::move(str)); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter66/list6608.hpp: -------------------------------------------------------------------------------- 1 | // Listing 66-8. The assignment_mixin Class Template 2 | template 3 | class assignment_mixin { 4 | public: 5 | T& operator=(T rhs) 6 | { 7 | rhs.swap(static_cast(*this)); 8 | return static_cast(*this); 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter66/list6610.cpp: -------------------------------------------------------------------------------- 1 | // Listing 66-10. Adding a Protected Constructor to the assignment_mixin Class Template 2 | template 3 | class assignment_mixin { 4 | public: 5 | T& operator=(T rhs) 6 | { 7 | rhs.swap(static_cast(*this)); 8 | return static_cast(*this); 9 | } 10 | protected: 11 | assignment_mixin() {} 12 | }; 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter67/list6703.cpp: -------------------------------------------------------------------------------- 1 | // Listing 67-3. Specializing iterator_advancer for Random Access Iterators 2 | // Partial specialization for random access iterators 3 | template<> 4 | class iterator_advancer 5 | { 6 | public: 7 | template 8 | void operator()(RandomIter& iter, Distance distance) 9 | { 10 | trace("iterator_advancer"); 11 | iter += distance; 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter67/list6704.cpp: -------------------------------------------------------------------------------- 1 | // Listing 67-4. Using Character Traits When Copying Input to Output 2 | #include 3 | #include 4 | #include 5 | #include // for char_traits 6 | 7 | int main() 8 | { 9 | typedef std::char_traits char_traits; // for brevity and clarity 10 | char_traits::int_type c{}; 11 | while (c = std::cin.get(), not char_traits::eq_int_type(c, char_traits::eof())) 12 | std::cout.put(char_traits::to_char_type(c)); 13 | } 14 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter68/gcd.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GCD_HPP_ 2 | #define GCD_HPP_ 3 | 4 | /// Compute greatest-common-denominator. 5 | /// @param n 6 | /// @param m 7 | template 8 | T gcd(T n, T m) 9 | { 10 | static const T zero{}; 11 | if (n < zero) 12 | n = -n; 13 | while (m != zero) { 14 | T tmp{n % m}; 15 | n = m; 16 | m = tmp; 17 | } 18 | return n; 19 | } 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter69/list6902.cpp: -------------------------------------------------------------------------------- 1 | // Listing 69-2. Overloading Named with a using Declaration 2 | #include 3 | 4 | class base { 5 | public: 6 | void print(int x) { std::cout << "int: " << x << '\n'; } 7 | }; 8 | class derived : public base { 9 | public: 10 | void print(double x) { std::cout << "double: " << x << '\n'; } 11 | using base::print; 12 | }; 13 | int main() 14 | { 15 | derived d{}; 16 | d.print(3); // prints int: 3 17 | d.print(3.0); // prints double: 3 18 | } 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter69/list6906.cpp: -------------------------------------------------------------------------------- 1 | // Listing 69-6. Default Arguments 2 | #include 3 | 4 | int add(int x = 0, int y = 0) 5 | { 6 | return x + y; 7 | } 8 | 9 | int main() 10 | { 11 | std::cout << add() << '\n'; 12 | std::cout << add(5) << '\n'; 13 | std::cout << add(32, add(4, add(6))) << '\n'; 14 | } 15 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter70/list7005.cpp: -------------------------------------------------------------------------------- 1 | // Listing 70-5. Implementing the is_same Metafunction 2 | template 3 | struct is_same : std::false_type {}; 4 | 5 | template 6 | struct is_same : std::true_type {}; 7 | 8 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter70/list7006.cpp: -------------------------------------------------------------------------------- 1 | // Listing 70-6. One Implementation of the promote Metafunction 2 | template struct promote { typedef T type; }; 3 | template<> struct promote { typedef int type; }; 4 | template<> struct promote { typedef int type; }; 5 | template<> struct promote { typedef int type; }; 6 | template<> struct promote { typedef int type; }; 7 | template<> struct promote { typedef int type; }; 8 | template<> struct promote { typedef int type; }; 9 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter70/list7007.cpp: -------------------------------------------------------------------------------- 1 | // Listing 70-7. Another Implementation of the promote Metafunction 2 | // Primary template when IsMember=std::true_type. 3 | template 4 | struct get_member { 5 | typedef T type; 6 | }; 7 | 8 | template 9 | struct get_member 10 | { 11 | typedef int type; 12 | }; 13 | 14 | template 15 | struct promote { 16 | typedef typename get_member::type, T>::type type; 18 | }; 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter70/list7009.cpp: -------------------------------------------------------------------------------- 1 | // Listing 70-9. One Way to Implement std::conditional 2 | template 3 | struct conditional 4 | { 5 | typedef IfFalse type; 6 | }; 7 | 8 | template 9 | struct conditional 10 | { 11 | typedef IfTrue type; 12 | }; 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter70/list7011.cpp: -------------------------------------------------------------------------------- 1 | // Listing 70-11. Implementing an Integer-Keyed Type Choice 2 | #include 3 | #include 4 | 5 | template 6 | typename std::enable_if::is_signed, T>::type 7 | minus(T const& x) 8 | { 9 | return -x; 10 | } 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter70/list7012.cpp: -------------------------------------------------------------------------------- 1 | // Listing 70-12. Specializing the rational Class Using enable_if 2 | #include 3 | #include 4 | 5 | template::is_integer, T>::type> 6 | class rational { 7 | public: 8 | ... normal class definition here ... 9 | }; 10 | 11 | rational okay{1, 2}; 12 | rational problem{1, 2}; 13 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for the calculator project 2 | 3 | CPPFLAGS = -MMD 4 | CXXFLAGS = -O0 -g3 -Wall -std=c++11 5 | 6 | SRC = parse.cpp 7 | OBJ = $(SRC:.cpp=.o) 8 | 9 | TESTSRC=\ 10 | test_main.cpp\ 11 | test_parse.cpp 12 | TESTOBJ = $(TESTSRC:.cpp=.o) 13 | 14 | all : calc tester 15 | ./tester 16 | 17 | calc : calc.o $(OBJ) 18 | $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ 19 | 20 | tester: $(OBJ) $(TESTOBJ) 21 | $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ 22 | 23 | .PHONY: clean 24 | clean: 25 | $(RM) calc tester *.o *.d 26 | 27 | -include *.d 28 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/calc.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "parse.hpp" 6 | 7 | /** @mainpage 8 | * This is step 1 of the calculator project in Exploration 68 of Exploring C++: 9 | * The Programmer's Introduction to C++. 10 | * 11 | * This version of the calculator implements simple arithmetic. It uses a recursive-descent 12 | * parser and immediately evaluates expressions using @c double for all values. 13 | */ 14 | int main() 15 | { 16 | parse_loop(std::cin, std::cout); 17 | } 18 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/bc_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/bdwn.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/classparse__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/classparse__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/closed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/doxygen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2blank.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2cl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2cl.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2doc.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2folderclosed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2folderopen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2lastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2lastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2link.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2mlastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2mlastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2mnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2mnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2mo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2mo.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2node.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2ns.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2plastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2plastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2pnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2pnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2splitbar.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/ftv2vertline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/ftv2vertline.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/nav_f.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/nav_g.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/nav_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/open.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/sync_off.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/sync_on.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/tab_a.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/tab_b.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/tab_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step1/html/tab_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step1/test_main.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_TEST_MAIN 2 | #include 3 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/bc_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/bdwn.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/classparse__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/classparse__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/closed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/doxygen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2blank.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2cl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2cl.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2doc.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2folderclosed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2folderopen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2lastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2lastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2link.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2mlastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2mlastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2mnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2mnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2mo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2mo.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2node.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2ns.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2plastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2plastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2pnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2pnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2splitbar.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/ftv2vertline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/ftv2vertline.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/nav_f.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/nav_g.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/nav_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/open.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/sync_off.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/sync_on.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/tab_a.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/tab_b.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/tab_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step2/html/tab_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/test_main.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_TEST_MAIN 2 | #include 3 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/variables.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "variables.hpp" 4 | 5 | namespace { 6 | std::map variables; 7 | 8 | class initializer { 9 | public: 10 | initializer() { 11 | variables["pi"] = 3.141592653589792; 12 | variables["e"] = 2.718281828459; 13 | } 14 | }; 15 | initializer init; 16 | } 17 | 18 | double get_variable(std::string const& name) 19 | { 20 | return variables[name]; 21 | } 22 | 23 | void set_variable(std::string name, double value) 24 | { 25 | variables[std::move(name)] = value; 26 | } 27 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step2/variables.hpp: -------------------------------------------------------------------------------- 1 | #ifndef VARIABLES_HPP_ 2 | #define VARIABLES_HPP_ 3 | 4 | #include 5 | 6 | /** Get the value of a variable. 7 | * @param name The variable name 8 | * @return The value of variable @p name or 0.0 if the variable is undefined. 9 | */ 10 | double get_variable(std::string const& name); 11 | 12 | /** Set the value of a variable. 13 | * @param name The variable name 14 | * @param value The value. if the variable is already defined, changes its value. 15 | */ 16 | void set_variable(std::string name, double value); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/bc_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/bdwn.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/classnode__add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/classnode__add.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/classnode__assign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/classnode__assign.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/classnode__binary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/classnode__binary.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/classnode__divide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/classnode__divide.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/classnode__identifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/classnode__identifier.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/classnode__impl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/classnode__impl.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/classnode__multiply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/classnode__multiply.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/classnode__negate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/classnode__negate.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/classnode__number.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/classnode__number.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/classnode__subtract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/classnode__subtract.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/classnode__unary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/classnode__unary.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/classnode__void.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/classnode__void.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/classparse__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/classparse__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/closed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/doxygen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2blank.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2cl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2cl.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2doc.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2folderclosed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2folderopen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2lastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2lastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2link.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2mlastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2mlastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2mnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2mnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2mo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2mo.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2node.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2ns.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2plastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2plastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2pnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2pnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2splitbar.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/ftv2vertline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/ftv2vertline.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/nav_f.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/nav_g.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/nav_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/open.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/sync_off.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/sync_on.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/tab_a.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/tab_b.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/tab_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step3/html/tab_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step3/test_main.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_TEST_MAIN 2 | #include 3 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/calc_error.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "calc_error.hpp" 4 | 5 | std::string function_error::msg(std::string const& name, std::size_t expected, std::size_t actual) 6 | { 7 | std::ostringstream stream{}; 8 | stream << "wrong number of arguments in call to " + name + "(), expected " << expected << ", got " << actual; 9 | return stream.str(); 10 | } 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/bc_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/bdwn.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classcalc__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classcalc__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classfunction__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classfunction__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classno__such__function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classno__such__function.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classnode__add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classnode__add.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classnode__binary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classnode__binary.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classnode__divide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classnode__divide.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classnode__function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classnode__function.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classnode__function__call.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classnode__function__call.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classnode__identifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classnode__identifier.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classnode__impl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classnode__impl.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classnode__multiply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classnode__multiply.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classnode__negate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classnode__negate.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classnode__number.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classnode__number.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classnode__subtract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classnode__subtract.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classnode__unary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classnode__unary.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classnode__void.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classnode__void.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classparse__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classparse__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/classsyntax__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/classsyntax__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/closed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/doxygen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2blank.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2cl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2cl.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2doc.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2folderclosed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2folderopen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2lastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2lastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2link.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2mlastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2mlastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2mnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2mnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2mo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2mo.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2node.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2ns.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2plastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2plastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2pnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2pnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2splitbar.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/ftv2vertline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/ftv2vertline.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/nav_f.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/nav_g.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/nav_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/open.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/sync_off.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/sync_on.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/tab_a.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/tab_b.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/tab_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step4/html/tab_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step4/test_main.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_TEST_MAIN 2 | #include 3 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/calc_error.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "calc_error.hpp" 4 | 5 | std::string function_error::msg(std::string const& name, std::size_t expected, std::size_t actual) 6 | { 7 | std::ostringstream stream{}; 8 | stream << "wrong number of arguments in call to " + name + "(), expected " << expected << ", got " << actual; 9 | return stream.str(); 10 | } 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/bc_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/bdwn.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classcalc__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classcalc__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classfile__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classfile__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classfunction__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classfunction__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classno__such__function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classno__such__function.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classnode__add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classnode__add.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classnode__binary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classnode__binary.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classnode__divide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classnode__divide.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classnode__function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classnode__function.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classnode__function__call.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classnode__function__call.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classnode__identifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classnode__identifier.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classnode__impl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classnode__impl.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classnode__multiply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classnode__multiply.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classnode__negate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classnode__negate.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classnode__number.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classnode__number.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classnode__subtract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classnode__subtract.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classnode__unary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classnode__unary.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classnode__void.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classnode__void.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classparse__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classparse__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/classsyntax__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/classsyntax__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/closed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/doxygen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2blank.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2cl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2cl.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2doc.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2folderclosed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2folderopen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2lastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2lastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2link.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2mlastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2mlastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2mnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2mnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2mo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2mo.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2node.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2ns.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2plastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2plastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2pnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2pnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2splitbar.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/ftv2vertline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/ftv2vertline.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/nav_f.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/nav_g.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/nav_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/open.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/sync_off.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/sync_on.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/tab_a.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/tab_b.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/tab_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step5/html/tab_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step5/test_main.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_TEST_MAIN 2 | #include 3 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/calc_error.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "calc_error.hpp" 4 | 5 | std::string function_error::msg(std::string const& name, std::size_t expected, std::size_t actual) 6 | { 7 | std::ostringstream stream{}; 8 | stream << "wrong number of arguments in call to " + name + "(), expected " << expected << ", got " << actual; 9 | return stream.str(); 10 | } 11 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/gcd.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GCD_HPP_ 2 | #define GCD_HPP_ 3 | 4 | /// Compute greatest-common-denominator. 5 | /// @param n 6 | /// @param m 7 | template 8 | T gcd(T n, T m) 9 | { 10 | static T zero{}; 11 | if (n < zero) 12 | n = -n; 13 | while (m != zero) { 14 | int tmp(n % m); 15 | n = m; 16 | m = tmp; 17 | } 18 | return n; 19 | } 20 | #endif 21 | -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/bc_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/bdwn.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classcalc__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classcalc__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classfile__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classfile__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classfunction__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classfunction__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classno__such__function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classno__such__function.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnode__add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnode__add.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnode__binary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnode__binary.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnode__divide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnode__divide.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnode__function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnode__function.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnode__function__call.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnode__function__call.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnode__identifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnode__identifier.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnode__impl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnode__impl.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnode__multiply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnode__multiply.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnode__negate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnode__negate.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnode__number.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnode__number.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnode__subtract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnode__subtract.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnode__unary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnode__unary.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnode__void.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnode__void.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnumber__double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnumber__double.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnumber__impl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnumber__impl.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnumber__long.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnumber__long.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnumber__rational.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnumber__rational.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classnumber__void.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classnumber__void.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classparse__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classparse__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classsyntax__error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classsyntax__error.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/classzero__denominator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/classzero__denominator.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/closed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/doxygen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2blank.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2cl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2cl.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2doc.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2folderclosed.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2folderopen.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2lastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2lastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2link.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2mlastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2mlastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2mnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2mnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2mo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2mo.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2node.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2ns.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2plastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2plastnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2pnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2pnode.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2splitbar.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/ftv2vertline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/ftv2vertline.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/nav_f.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/nav_g.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/nav_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/open.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/sync_off.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/sync_on.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/tab_a.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/tab_b.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/tab_h.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/chapter71/step6/html/tab_s.png -------------------------------------------------------------------------------- /exploring-cpp-2e/chapter71/step6/test_main.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_TEST_MAIN 2 | #include 3 | -------------------------------------------------------------------------------- /exploring-cpp-2e/data/greek-8859-7.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/data/greek-8859-7.txt -------------------------------------------------------------------------------- /exploring-cpp-2e/data/greek-utf8.txt: -------------------------------------------------------------------------------- 1 | this is not a palindrome 2 | Νιψον ανομηματα μη μοναν οψιν. 3 | -------------------------------------------------------------------------------- /exploring-cpp-2e/data/hebrew-8859-8.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/data/hebrew-8859-8.txt -------------------------------------------------------------------------------- /exploring-cpp-2e/data/hebrew-utf8.txt: -------------------------------------------------------------------------------- 1 | פרשנו רעבתן שבדבש נתבער ונשרף 2 | -------------------------------------------------------------------------------- /exploring-cpp-2e/data/palindrome-8859-1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/data/palindrome-8859-1.txt -------------------------------------------------------------------------------- /exploring-cpp-2e/data/palindrome-utf8.txt: -------------------------------------------------------------------------------- 1 | this is not a palindrome 2 | Eve 3 | Madam, I’m Adam 4 | Lëon saw I was Noël 5 | ¡A man—a plan—a canal! Panama! 6 | Νιψον ανομηματα μη μοναν οψιν. 7 | Я дядя! А я тётя! А я дядя! 8 | -------------------------------------------------------------------------------- /exploring-cpp-2e/data/russian-8859-5.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/data/russian-8859-5.txt -------------------------------------------------------------------------------- /exploring-cpp-2e/data/russian-koi8-r.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/data/russian-koi8-r.txt -------------------------------------------------------------------------------- /exploring-cpp-2e/data/russian-utf8.txt: -------------------------------------------------------------------------------- 1 | Я дядя! А я тётя! А я дядя! 2 | -------------------------------------------------------------------------------- /exploring-cpp-2e/data/sample-euc-kr.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/data/sample-euc-kr.txt -------------------------------------------------------------------------------- /exploring-cpp-2e/data/sample-iso-8859-5.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/data/sample-iso-8859-5.txt -------------------------------------------------------------------------------- /exploring-cpp-2e/data/sample-iso-8859-7.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/data/sample-iso-8859-7.txt -------------------------------------------------------------------------------- /exploring-cpp-2e/data/sample-iso8859-1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/data/sample-iso8859-1.txt -------------------------------------------------------------------------------- /exploring-cpp-2e/data/sample-koi8-r.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/data/sample-koi8-r.txt -------------------------------------------------------------------------------- /exploring-cpp-2e/data/sample-shift_jis.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/exploring-c-11/3cc28fedaa47af9a0659cbec7846236678ef0376/exploring-cpp-2e/data/sample-shift_jis.txt --------------------------------------------------------------------------------