목록개발 공부 (130)
음악, 삶, 개발
원문 : https://isocpp.org/wiki/faq What is C++? Is C++ a practical language? Is C++ a perfect language? What is the zero-overhead principle? What’s so great about classes? What’s the big deal with OO? What’s the big deal with generic programming? What is multiparadigm programming? Is C++ better than Java? (or C#, C, Objective-C, JavaScript, Ruby, Perl, PHP, Haskell, FORTRAN, Pascal, Ada, Smalltalk..
Container Item 1. Choose your containers with care. Item 2. Beware the illusion of container-independent code. Item 3. Make copying cheap and correct for objects in containers. Item 4. Call empty instead of checking size() against zero. Item 5. Prefer range member functions to their single-element counterparts. Item 6. Be alert for C++'s most vexing parse. Item 7. When using containers of newed ..
From the Publisher Acknowledgments Introduction 1. Deducing Types Item 1: Understand template type deduction. Item 2: Understand auto type deduction. Item 3: Understand decltype. Item 4: Know how to view deduced types. 2. auto Item 5: Prefer auto to explicit type declarations. Item 6: Use the explicitly typed initializer idiom when auto deduces undesired types. 3. Moving to Modern C++ Item 7: Di..
Acknowledgments Introduction Basics Item 1: Distinguish between pointers and references. Item 2: Prefer C++-style casts. Item 3: Never treat arrays polymorphically. Item 4: Avoid gratuitous default constructors. Operators Item 5: Be wary of user-defined conversion functions. Item 6: Distinguish between prefix and postfix forms of increment and decrement operators. Item 7: Never overload &&, ||, ..
Preface Acknowledgments Introduction Chapter 1 : Accustoming Yourself to C++ Item 1: View C++ as a federation of languages. Item 2: Prefer consts, enums, and inlines to #defines. Item 3: Use const whenever possible. Item 4: Make sure that objects are initialized before they’re used. Chapter 2: Constructors, Destructors, and Assignment Operators Item 5: Know what functions C++ silently writes and..
참고자료 Const Correctness
24807 : Why is processing a sorted array faster than processing an unsorted array? 9086 : What is the ??->??operator in C++? 4242 : The Definitive C++ Book Guide and List 3338 : What are the differences between a pointer variable and a reference variable in C++? 3026 : How do I iterate over the words of a string? 2989 : What does the explicit keyword mean? 2719 : Why is ?쐕sing namespace std;??co..
참고자료 Programiz : C++ Functions Google C++ Style Guide : Functions C++ Core Guidelines : Functions (영문) C++ Core Guidelines : 함수 (한글) Stackoverflow : Should I return const objects? Stackoverflow : Purpose of returning by const value? Stackoverflow : What are the use cases for having a function return by const value for non-builtin type? Stackoverflow : Is the practice of returning a C++ reference..
요약 - 연산자별로 규칙과 주의사항이 틀리니, 다 따로 공부해야한다. - =, (), [ ], -> 연산자는 반드시 멤버 함수여야한다. - 멤버 함수일때는 한 개의 인자, 전역 함수일때는 2개의 인자가 필요하다. (3개 이상은 가질수없음) - + 연산자는 교환법칙이 성립해도록 (예 : myClass + 1 또는 1 + myClass) 멤버 함수, 전역 함수 둘다 정의되어야함. (코드 참조) - + 연산자는 좌측 피연산자, 우측 피연산자, return type 모두 읽기만 하기때문에 모두 const. 따라서 함수도 () const {} - + 연산자는 return type은 const, 인자는 const reference - 연산자 오버로딩 함수 구현시, 생성자를 활용한다. - 오버로딩 함수의 피연산자중 ..