ABRAXAS SOFTWARE - CodeCheck Meyers: Effective C++ Test-Suite Meyers: Effective C++ Test Suite for Module - m18.cpp
// Item 18: Make interfaces easy to use correctly and hard to use incorrectly. 78
struct M { explicit M(int m) : val(m){} int val;
Function Name: M()
};
struct D { explicit D(int d) : val(d){} int val;
Function Name: D()
};
struct Y { explicit Y(int y) : val(y){} int val;
Function Name: Y()
};
class Date {public:
Date( const M& m, const D& d, const Y& y );
};
// bad
struct M { explicit M(int m) {} int val;
Function Name: M()
};
struct D { explicit D(int d) {} int val;
Function Name: D()
};
struct Y { explicit Y(int y) {} int val;
Function Name: Y()
};
class Date {public:
Date( const M& m, const D& d, const Y& y );
};
Abraxas/Meyers: Effective C++ Home Table of Contents
ABRAXAS SOFTWARE - CodeCheck Meyers: Effective C++ Test-Suite