mec++ chapter3,4

Click here to load reader

Upload: -

Post on 23-Jun-2015

63 views

Category:

Technology


7 download

TRANSCRIPT

  • 1. More effective C++ NHN NEXT

2. 9: 3. auto_ptr 4. auto_ptr try-catch 5. 6. 7. 10: C++ . . try-catch . 8. try-catch 9. try-catch 10. try-catch 11. auto_ptr 12. 11: ? , (scope) (delete) , (exception propagation) , . 13. C++ terminate . . , C++ terminate . . 14. terminate 15. logDestruction Session 16. logDestruction Session 17. 18. 12: 19. 20. 21. 22. 23. catch 24. catch 25. 26. catch() , const void* catch . catch (const void*) 27. 3 catch . catch , catch . 28. catch 29. 13: catch . , , . 30. 31. . ? . , . C++ . . 32. (catch-by-value) C++ . . (slicing problem): , catch 33. slicing problem 34. (catch-by-reference) . C++ . . 35. 14: (exception specification): 36. 37. . 38. (C++ ) bad_alloc operator new operator new[] . 39. 40. 41. . C++ . , . 42. 15: . . . 43. try try , . try , try . . . 44. 16: 80-20 80% 20% . 80% 20% . 80% 20% . 80% 20% . 80% 20% . . 45. program profiler 20% . . . 46. 17: (lazy evaluation) (to be lazy): : C++ . . 47. (reference counting) 48. 49. (lazy fetching) 50. lazy fetching 51. mutable const . mutable . const . 52. (lazy expression evaluation) 53. . . , , . / . 54. 18: (over-eager evaluation) . 55. 56. . . . 57. 58. (prefetching) , . . locality of reference 59. prefetching 60. prefetching 61. prefetching 62. . . . prefetching . . . 63. 19: 64. (return by value) 65. 66. . . 67. (reference-to- const) (reference-to-non-const) . 68. . 69. return 70. 20: 71. 72. inline 73. 21: 74. 75. 22: op op= 76. op+= 77. . , , , . 78. . 79. 80. 81. 23: , , , , , , , , , . . , , . . 82. 24: , virtual function virtual table(vtbl): ( linked list ). , vtbl . 83. 84. . vtbl ( ) . vtbl , vtbl ? 85. vptr . vptr . vptr . vptr . 86. (inline): , . (virtual): . . 87. 88. 89. 90. (RTTI) runtime type identification . C++ . . 91. RTTI vtbl 92. , , , RTTI