#include <iostream>
class Example {
private:
int m_A;
public:
explicit Example(int a) : m_A(a) {} // explicit disable implicit Conversion
void Print() const {
std::cout << m_A << "\n";
}
};
int main() {
Example ex = 98; // Implicit Conversion // Constrct Example with 98
ex.Print();
}
/*
run:
error: conversion from ‘int’ to non-scalar type ‘Example’ requested
*/