강의

멘토링

커뮤니티

Inflearn Community Q&A

eric13066467's profile image
eric13066467

asked

[All-in-One Introduction to Game Programming] C++ & Data Structures/Algorithms & STL & Game Mathematics & Windows API & Game Server

Operator overloading

explicit을 붙였을 때 빨간줄이 뜨는 이유가 맞는지 궁금합니다.

Written on

·

78

0

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요!
- 먼저 유사한 질문이 있었는지 검색해보세요.
- 서로 예의를 지키며 존중하는 문화를 만들어가요.
- 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.

 

안녕하세요 루키스님. 좋은 강의 제공해주셔서 감사합니다.

 

13:56초에서 한개의 인자를 받는 Pos 생성자에 explicit을 붙이니 main 함수에 있는 일부 문법들이 빨간줄이 뜨는 이유가, 암시적으로 변환되던 아래의 구문이

Pos pos1 = 10; -> Pos pos1(10);

explicit 키워드를 붙임으로써 대입연산자의 생성자로 암시적 변환이 막힌 것이고, 따라서 빨간줄이 뜬다고 생각하면 되는걸까요?

 

c++네트워크ue-blueprint게임수학windows-api

Answer

This question is waiting for answers
Be the first to answer!
eric13066467's profile image
eric13066467

asked

Ask a question