mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Merge pull request #1061 from planetchili/master
struct -> class to conform to C8
This commit is contained in:
commit
3d282d21ed
|
@ -4198,7 +4198,7 @@ This may be exactly what we want, but if we want to enforce a relation among mem
|
||||||
and enforce that relation (invariant) through constructors and member functions.
|
and enforce that relation (invariant) through constructors and member functions.
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
struct Distance {
|
class Distance {
|
||||||
public:
|
public:
|
||||||
// ...
|
// ...
|
||||||
double meters() const { return magnitude*unit; }
|
double meters() const { return magnitude*unit; }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user