構造体やclassのコンストラクタにつけることで暗黙的な型変換を防止する機能
struct A {
explicit A(int);
};
struct B {
B(A) {}
};
int main(){
// B b(1);
return 0;
}
型変換できない
ソフトウェアエンジニアの技術ブログ:Software engineer tech blog
随机应变 ABCD: Always Be Coding and … : хороший