λ°μν
μ 체 κΈ
[Error] Pristine text '~~~' not present
[Error] Pristine text '~~~' not present
2022.01.11svn update μ€ λΈλ£¨μ€ν¬λ¦°μ΄ λ μ μλ ν¬μ€ν
μ μ§ννμλλ° https://cjwoov.tistory.com/75 [Error] sqllite: database disk image is malformed. svn updateλ₯Ό νλ μ€ μ»΄ν¨ν° λΈλ£¨μ€ν¬λ¦°μ΄ λ¨κ³ λμ μ¬λΆν
μ΄ν λ€μ updateλ₯Ό λ°μ보λ μλμ κ°μ μλ¬κ° λ°μνμλ€. sqllite: database disk image is malformed. λ€μκ³Ό κ°μ λͺ
λ Ήμ΄λ₯Ό ν΄λΉ svn νλ‘μ .. cjwoov.tistory.com μλμ κ°μ΄ μΆκ°μ μΈ μλ¬κ° λ°μνμλ€. Pristine text 'a31e85c8d4β¦089ed435e' not present λ€μ λͺ
λ Ήμ΄λ₯Ό ν΅ν΄ ν΄κ²°νμλ€. sqlite3 .svn/wc.db "SELECT ..
[Error] sqllite: database disk image is malformed.
[Error] sqllite: database disk image is malformed.
2022.01.11svn updateλ₯Ό νλ μ€ μ»΄ν¨ν° λΈλ£¨μ€ν¬λ¦°μ΄ λ¨κ³ λμ μ¬λΆν
μ΄ν λ€μ updateλ₯Ό λ°μ보λ μλμ κ°μ μλ¬κ° λ°μνμλ€. sqllite: database disk image is malformed. λ€μκ³Ό κ°μ λͺ
λ Ήμ΄λ₯Ό ν΄λΉ svn νλ‘μ νΈ ν΄λμ cmdμ°½μ λμλκ³ μ
λ ₯ν΄λ³΄μλ€. sqlite3 .svn/wc.db "pragma intergrity_check" // ~~ // μ΄λμ λ¬Έμ κ° μλμ§ μΆλ ₯ λ¨ // ~~ sqlite3 .svn/wc.db "reindex nodes" sqlite3 .svn/wc.db "reindex pristine" // μ΄ν svn cleanup μ§ν μ°Έκ³ λ° μΆμ² https://blog.naver.com/toytimes/220985010617
ν΄λΌμ΄μΈνΈμ μΉ κ²μμ ν΅μ κ΄κ³(feat. μ΄λ²€νΈνμ΄μ§)
ν΄λΌμ΄μΈνΈμ μΉ κ²μμ ν΅μ κ΄κ³(feat. μ΄λ²€νΈνμ΄μ§)
2021.03.30λ³΄ν΅ κ²μμμ ν΅μ μ νλ¦μ λ€μκ³Ό κ°μ΄ ν΄λΌμ΄μΈνΈκ° μμ²νκ³ μλ²κ° κ·Έμλν΄ μλ΅νλ λ°©μμ κ·Έλ λ€λ©΄ λ°λλ‘ μλμ κ°μ΄ μλ²κ° λ¨Όμ μμ²νκ±°λ λͺ
λ Ήνλ κ²½μ°λ μμκΉ? μλ€κ³ λ΄λ 무방ν¨. κ²μμΌλ‘ μλ₯Ό λ€μλ©΄ μμ κ°μ΄ λ΄ λͺ¬μ€ν°κ° μλλ°©μ λͺ¬μ€ν°λ₯Ό μ£½μ¬μ μ¬νλ₯Ό μ»λ κ²½μ°λ μλμ κ°κ² μ§? 1. ν΄λΌμ΄μΈνΈκ° νΉμ λͺ¬μ€ν°(ν¬νμ΄λ)λ₯Ό μ¬λ₯νλ€κ³ μλ²μκ² μμ²νλ©΄, 2. μλ²λ μ§μ§λ‘ κ·Έ λͺ¬μ€ν°κ° μ¬λ₯λμλμ§ λ°μ΄ν°λ₯Ό κ²ν ν΄μ νμΈνκ³ μ§μ§λ‘ μ£½μλ€λ©΄? μλ²μ μ μ₯λμ΄μλ 보μ ν
μ΄λΈμ κ²μν΄(ν¬νμ΄λ μ¬λ₯νμ λ 보μμ 무μμΈκ°?) 3. κ·Έ 보μμ μλ² λ΄ λ°μ΄ν°λ² μ΄μ€μ μ μ₯νκ³ ν΄λΌμ΄μΈνΈμͺ½μΌλ‘ κ²½νμΉ 300 μ¬λ Έλ€κ³ μλ΅ν΄μ€ 4. ν΄λΌμ΄μΈνΈλ κ·Έ μλ΅μ λ°κ³ μλ²κ° 보λ΄μ€ κ²½νμΉλ§νΌ κ²½νμΉ μμΉν..
[C++11] keyword: static_assert
[C++11] keyword: static_assert
2020.07.231. μ€λͺ
statc_assertλ C++11μ μΆκ°λ ν€μλλ‘, μΈμλ‘ μ λ¬λ μμ΄ μ°ΈμΈμ§ μλμ§ μ»΄νμΌ νμμ νμΈνλ€. static_assertμ μ λ¬λ μμ΄ μ°Έμ΄λΌλ©΄, μ»΄νμΌλ¬μ μν΄ ν΄λΉ μμ 무μλκ³ , κ±°μ§μ΄λΌλ©΄ ν΄λΉ λ¬Έμ₯μμ μ»΄νμΌ μ€λ₯λ₯Ό λ°μμν¨λ€. static_assert( constant-expression, string-literal ); static_assert( constant-expression ); // C++17 (Visual Studio 2017 and later) μ»΄νμΌ νμμ μνλλ ν€μλμ΄λ―λ‘ μ²« λ²μ§Έ μΈμ μμ μ»΄νμΌ νμμ¬ κ²°μ λ μ μλ μΈμμ¬μΌ νλ€. static_assert(sizeof(void *) == 4, "64-bit code generation is..
[C++] keyword: enum class
[C++] keyword: enum class
2020.07.231. μ€λͺ
C++03κΉμ§μ enumμ μ¬λ¬κ°μ§ λ¬Έμ λ₯Ό κ°μ§κ³ μμλ€. κ·Έλμ κ·Έ λ¬Έμ λ₯Ό ν΄κ²°νκ³ μ C++11λΆν° enum classλΌλ κ²μ΄ λ±μ₯νλ€. κΈ°μ‘΄ enumμ λ¬Έμ μ λ€μ λ€μκ³Ό κ°λ€. 1.1) κΈ°μ‘΄ enumμ λ¬Έμ 1.1.1) μ λ°© μ μΈ λΆκ°λ₯ κΈ°μ‘΄ enumμ enumeratorμ μ΄λ€ κ°μ΄ λ€μ΄μμμ§ μ μ μμΌλ©΄ κ·Έ ν¬κΈ°λ₯Ό μ ν μ μκΈ° λλ¬Έμ μ λ°© μ μΈμ ν μ μλ€. enum Fruit; // μ λ°© μ μΈ λΆκ°λ₯ void main() { Fruit f = Apple; // λ°λΌμ ν΄λΉ enumμ μ°Ύμμ μμ } enum Fruit { Apple, Banana, Peach, }; λ°λΌμ μμ κ°μ΄ μ»΄νμΌμ ν μ μμΌλ©° 맀 νμΌ μλ¨μ enumμ μ μν΄μ€μΌ νλ λΆνΈν¨μ΄ μλ€. 1.1.2) ..
[C++] keyword: static_cast, dynamic_cast, reinterpret_cast, const_cast
[C++] keyword: static_cast, dynamic_cast, reinterpret_cast, const_cast
2020.07.231. μ€λͺ
Cμ μΊμ€νΈ μ°μ°μλ λ³μμ νμ
μ λ°κΏ μ μλ€λ λ©΄μμ νΈλ¦¬νκ³ μ μ°ν μ½λ μμ±μ λμμ€λ€. νμ§λ§ λ무 무μ±
μνκ³ κ°λ°μμκ² λͺ¨λ κ²μ λ λκΈ΄λ€. C++μμλ μ’ λ μμ νκ³ λ³ν λͺ©μ μ λ§κ² κ³¨λΌ μΈ μ μλ 4κ°μ μλ‘μ΄ μΊμ€νΈ μ°μ°μλ₯Ό μ 곡νλ€. static_cast reinterpret_cast dynamic_cast const_cat 1.1) static_cast static_cast μ°μ°μλ μ§μ ν νμ
μΌλ‘ λ³κ²½νλλ° λ¬΄μ‘°κ±΄ λ³κ²½νλ κ²μ΄ μλλΌ λ
Όλ¦¬μ μΌλ‘ λ³ν κ°λ₯ν νμ
λ§ λ³ννλ€. void main() { const char* str = "korea"; int* pi; double d = 123.456; int i; i = static_cast(d); // κ°λ₯ pi =..
[C++] keyword: noexcept
[C++] keyword: noexcept
2020.07.231. μ€λͺ
λ§μ½μ μ΄λ€ ν¨μκ° μμΈλ₯Ό λ°μμν€μ§ μλλ€λ©΄ noexcept ν€μλλ₯Ό ν΅ν΄ λͺ
μν μ μλ€. int foo() noexcept {} foo ν¨μμ κ²½μ° μμΈλ₯Ό λ°μμν€μ§ μμΌλ―λ‘ μμ κ°μ΄ ν¨μ μ μ μμ noexceptλ₯Ό λ£μμΌλ‘μ¨ λνλΌ μ μλ€. #include using namespace std; int foo() noexcept { return 0; } int bar() noexcept { throw 1; } int main() { foo(); try { bar(); } catch (int x) { std::cout
[C++11] keyword: constexpr
[C++11] keyword: constexpr
2020.07.231. μ€λͺ
constexpr ν€μλλ κ°μ²΄λ ν¨μ μμ λΆμΌ μ μλ ν€μλλ‘, ν΄λΉ κ°μ²΄λ ν¨μμ λ¦¬ν΄ κ°μ μ»΄νμΌ νμμ κ°μ μ μ μλ€λ μλ―Έλ₯Ό μ λ¬νλ€. int arr[size]; μ λ°°μ΄ μ μΈμμ΄ μ»΄νμΌλκΈ° μν΄μλ sizeκ° μ μ μμ μμ΄μ¬μΌ νκ³ template struct A { int operator()() { return N; } }; A a; ν
νλ¦Ώ νμ
μΈμμ κ²½μ°λ λ§μ°¬κ°μ§λ‘ numberκ° μ μ μμμμ΄μ¬λ§ νλ€. κ·Έ μΈμλ, enum A { a = number, b, c }; enumμμ κ°μ μ§μ ν΄μ€ λμ μ€λ number μμ μ μ μμ μμ΄μ¬λ§ νλ€. constexprμ μμ λ§ν λλ‘, μ΄λ ν μμ΄ μμμμ΄λΌκ³ λͺ
μν΄μ£Όλ ν€μλλ€. #include using names..
[C++] keyword: using
[C++] keyword: using
2020.07.231. μ€λͺ
using ν€μλλ λ€μκ³Ό κ°μ΄ νμ©ν μ μλ€. 1. namespace using μ§μμ(Directive) 2. namespace using μ μΈ(Declaration) 3. νμ
μ μ 4. ν΄λμ€ κ³μΈ΅μμμ μ¬μ© 1.1) namespace using μ§μμ(Directive) λ€μ μ€νμ΄μ€λ λͺ
μΉμ μ μΈ μμμ λΆλ¦¬ν΄μ μΆ©λμ λ°©μ§νλ€. κ·Έλμ λ€μ μ€νμ΄μ€ μμ λͺ
μΉμ μ μΈνλ©΄ μ΄λ¦μ λΆμΌ λ μΆ©λμ κ±±μ νμ§ μκ³ μμ λ‘κ² μ΄λ¦μ λΆμΌ μ μλ€. κ·Έλ¬λ μ΄λ κ² μμ±λ λͺ
μΉμ μ¬μ©νλ €λ©΄ λ§€λ² μμμ λ°νμΌ νλ―λ‘ λ§€μ° λ²κ±°λ‘λ€. λ°λΌμ using namespace (λ€μ μ€νμ΄μ€ μ΄λ¦)μ ν΅ν΄ λ§€λ² λ€μ μ€νμ΄μ€λ₯Ό μλ΅νκ³ λ°λ‘ μ¬μ©ν μ μλ€. #include using namespac..
[C++] keyword: friend
[C++] keyword: friend
2020.07.231. μ€λͺ
friend ν€μλλ ν΄λμ€ λ΄λΆμμ λ€λ₯Έ ν΄λμ€λ ν¨μλ€μ friendλ‘ μ μν μ μλ€. friendλ‘ μ μλ ν΄λμ€λ ν¨μλ€μ μλμ ν΄λμ€μ privateλ‘ μ μλ λ³μλ ν¨μλ€μ μ κ·Όν μ μλ€. class A { private: void private_func() {} int private_num; // B λ A μ μΉκ΅¬! friend class B; // func μ A μ μΉκ΅¬! friend void func(); }; class B { public: void b() { A a; // λΉλ‘ private ν¨μμ νλλ€μ΄μ§λ§ μΉκ΅¬μ΄κΈ° λλ¬Έμ μ κ·Ό κ°λ₯νλ€. a.private_func(); a.private_num = 2; } }; void func() { A a; // λΉλ‘ pr..
[C++] keyword: static
[C++] keyword: static
2020.07.231. μ€λͺ
static ν€μλλ C++μμ νΉλ³ν νΉμ±μ λΆμ¬νλ λ° μ¬μ©νλ€. staticμΌλ‘ μ μΈλ κ²λ€μ νλ‘κ·Έλ¨ μ€ν μκ° λμ ν λ²λ§ μ μ λ°μ΄ν° μμμ μ μ₯λκ³ , νλ‘κ·Έλ¨ μ€ν λμ μ μ§λλ€. static ν€μλλ λ€μκ³Ό κ°μ΄ μ¬μ©λλ€. 1. ν¨μ λ΄μμ static λ³μ 2. static ν΄λμ€ κ°μ²΄ 3. ν΄λμ€ λ΄ static λ©€λ² λ³μ 4. ν΄λμ€ λ΄ static ν¨μ 2. μμ 2.1) ν¨μ λ΄μμ static λ³μ #include using namespace std; void counter() { static int count = 0; cout
[C++] keyword: explicit
[C++] keyword: explicit
2020.07.221. μ€λͺ
explicit ν€μλλ₯Ό μ¬μ©νλ©΄ μ»΄νμΌλ¬μ μμμ νλ³νμ λ§μ μ μλ€. class A { public: int num; explicit A(int num) : num(num) {} }; 2. μμ 2.1) explicit ν€μλλ₯Ό μ¬μ©νμ§ μμ κ²½μ°(μμμ νλ³νμ΄ μΌμ΄λ κ²½μ°) #include using namespace std; class A { public: int num; A(int num) : num(num) {} }; void print_a(A a) { cout