[C++ Korea] Effective Modern C++ Study item14 16 +신촌Seok-joon Yun
[C++ Korea] Effective Modern C++ Study item14 16 +신촌
Item 14 : Declare functions noexcept if they won't emit exceptions. +윤석준
Item 15 : Use constexpr whenever possible. +이동우
Item 16 : Make const member functions thread safe. +제한재
[C++ Korea] Effective Modern C++ Study item14 16 +신촌Seok-joon Yun
[C++ Korea] Effective Modern C++ Study item14 16 +신촌
Item 14 : Declare functions noexcept if they won't emit exceptions. +윤석준
Item 15 : Use constexpr whenever possible. +이동우
Item 16 : Make const member functions thread safe. +제한재
[C++ korea] Effective Modern C++ 신촌 Study Item20,21,23Seok-joon Yun
[C++ korea] Effective Modern C++ 신촌 Study Item20,21,23
Item 20, 21, 23
Item 20 : Use std::weak_ptr for std::shared_ptr-like pointers that can dangle. +정은식
Item 21 : Prefer std::make_unique and std::make_shared to direct use of new. +이동우
Item 23 : Understand std::move and std::forward. +제한재
[C++ Korea] Effective Modern C++ Study item 24-26Seok-joon Yun
[C++ Korea] Effective Modern C++ Study item 24-26
Item 24: Distinguish universal references from rvalue references. +석정로
Item 25 : Use std::move on rvalue references,
std::forward on universal references. +서승덕
Item 26 : Avoid overloading on universal references. +윤석준
[C++ Korea 2nd Seminar] C++17 Key Features SummaryChris Ohk
C++은 10년 만에 C++11/14를 발표하면서 '모던 C++'이라는 이름으로 발전했습니다. 그만큼 새로운 기능들이 많이 추가되었습니다. 그리고 2017년, C++은 C++17이라는 이름으로 또 한 번의 발전을 준비하고 있습니다. 3년 주기로 빠르게 변화하는 모던 C++에 대비하기 위해, C++17에 추가될 주요 기능들을 살펴보고자 합니다.
[C++ korea] Effective Modern C++ 신촌 Study Item20,21,23Seok-joon Yun
[C++ korea] Effective Modern C++ 신촌 Study Item20,21,23
Item 20, 21, 23
Item 20 : Use std::weak_ptr for std::shared_ptr-like pointers that can dangle. +정은식
Item 21 : Prefer std::make_unique and std::make_shared to direct use of new. +이동우
Item 23 : Understand std::move and std::forward. +제한재
[C++ Korea] Effective Modern C++ Study item 24-26Seok-joon Yun
[C++ Korea] Effective Modern C++ Study item 24-26
Item 24: Distinguish universal references from rvalue references. +석정로
Item 25 : Use std::move on rvalue references,
std::forward on universal references. +서승덕
Item 26 : Avoid overloading on universal references. +윤석준
[C++ Korea 2nd Seminar] C++17 Key Features SummaryChris Ohk
C++은 10년 만에 C++11/14를 발표하면서 '모던 C++'이라는 이름으로 발전했습니다. 그만큼 새로운 기능들이 많이 추가되었습니다. 그리고 2017년, C++은 C++17이라는 이름으로 또 한 번의 발전을 준비하고 있습니다. 3년 주기로 빠르게 변화하는 모던 C++에 대비하기 위해, C++17에 추가될 주요 기능들을 살펴보고자 합니다.
3. Before Beginning:
▪Java와 C의 다른 점
▪ 주소 개념을 사용하지 않는다 == 포인터가 없다
▪ 배열을 선언할 때
▪ int arr1[3];(x) int[] arr1 = new int[3];(o)
▪ int arr2[3][3];(x) int[][] arr2 = new int[3][3];(o)
▪ 자기보다 큰 자료형의 값을 대입할 땐 명시적 형 변환 필수!
▪ long num1; int num2 = num1; (x)
▪ long num1; int num2 = (int)num1; (o)
▪ bool(x) boolean(o)
▪ 논리 연산에는 무조건 boolean만 사용해야 한다
▪ 정수형과 호환 안 됨(시무룩)
▪ const 대신 final
8. 1st Program:
▪void setup()
▪ 아두이노의 setup()과 비슷한 기능
▪ 프로그램이 시작될 때 단 한 번 실행됨
▪ 초기화할 때 사용함
▪void size(width, height)
▪ 화면의 사이즈를 지정해줄 수 있다(단위: pixel)
▪void background(R, G, B)
▪ 화면의 배경색을 설정할 수 있다(0<=R,G,B<=255, 정수)
11. 2nd Program:
▪width, height
▪ 화면 사이즈에 따라 알아서 값이 바뀌는 시스템 변수
▪void draw()
▪ 아두이노의 loop()와 비슷
▪void rect(x, y, w, h)
▪ 직사각형 그리는 함수
▪ x, y: 원점 좌표
▪ w, h: 너비, 높이
▪ 사실 옵션이 더 있는데, 패스합니다…
12. 2nd Program:
▪void rectMode(mode)
▪ mode에 따라 rect()의 표현방식이 달라진다
↑ 똑같은 프로그램을 mode만 바꿔서 그려보았다
CENTER CORNER
(기본값)
CORNERS
RADIUS
h
w w
h
w
h
원점(x, y)
다른 점(w, h)
13. 2nd Program: Going Further
▪도형의 윤곽선을 없애고 싶어요!
▪ rect()를 사용하기 전에 noStroke();를 추가해 보세요
▪윤곽선 말고 안쪽 색을 없애고 싶어요!
▪ rect()를 사용하기 전에 noFill();을 추가해 보세요
▪ noStroke();와 같이 쓰지 않도록 주의!
▪도형의 색깔을 바꾸고 싶어요!
▪ rect()를 사용하기 전에 fill(R, G, B, opacity);를 추가해 보세요
▪ 0<=opacity<=255 (값이 작을수록 투명해짐, 실수)
▪선 색깔은 바꿀 수 없나요?
▪ rect()를 사용하기 전에 stroke(R, G, B, opacity);를 추가해 보세요
14. 2nd Program: Going Further
▪사각형 말고 다른 건 못 그리나요?
▪ 그릴 수 있습니다. 레퍼런스를 참조하세요
▪ 특히 quad()나 ellipse(), arc() 정도는 알아두는 것이 좋습니다
▪ quad(): 그냥 사각형(직사각형 말고)
▪ ellipse(): 원/타원
▪ arc(): 부채꼴/활꼴
▪사각형 그릴 때는 몰랐는데, 원을 그리니까 선이 깨져요ㅠ
▪ smooth() 함수를 이용해 보세요. 반대는 noSmooth()입니다