diff options
author | Christian Parpart <christian@ethereum.org> | 2018-12-12 21:43:34 +0800 |
---|---|---|
committer | Christian Parpart <christian@ethereum.org> | 2018-12-19 18:21:45 +0800 |
commit | d10bae245ed441314c3bd6ecc74b2a1f3d060d12 (patch) | |
tree | 1c93d817c44d86d5d3c8ee5c79d04196de289132 /liblangutil/SourceLocation.h | |
parent | 678a95f6e3bbd9f1c4914151c0178847348de970 (diff) | |
download | dexon-solidity-d10bae245ed441314c3bd6ecc74b2a1f3d060d12.tar dexon-solidity-d10bae245ed441314c3bd6ecc74b2a1f3d060d12.tar.gz dexon-solidity-d10bae245ed441314c3bd6ecc74b2a1f3d060d12.tar.bz2 dexon-solidity-d10bae245ed441314c3bd6ecc74b2a1f3d060d12.tar.lz dexon-solidity-d10bae245ed441314c3bd6ecc74b2a1f3d060d12.tar.xz dexon-solidity-d10bae245ed441314c3bd6ecc74b2a1f3d060d12.tar.zst dexon-solidity-d10bae245ed441314c3bd6ecc74b2a1f3d060d12.zip |
liblangutil: SourceLocation to default initialize data members (w/o the use of ctor)
See: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c45-dont-define-a-default-constructor-that-only-initializes-data-members-use-in-class-member-initializers-instead
Diffstat (limited to 'liblangutil/SourceLocation.h')
-rw-r--r-- | liblangutil/SourceLocation.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/liblangutil/SourceLocation.h b/liblangutil/SourceLocation.h index 2d18a7d1..840891c2 100644 --- a/liblangutil/SourceLocation.h +++ b/liblangutil/SourceLocation.h @@ -38,10 +38,6 @@ namespace langutil */ struct SourceLocation { - SourceLocation(): start(-1), end(-1), source{nullptr} { } - SourceLocation(int _start, int _end, std::shared_ptr<CharStream> _source): - start(_start), end(_end), source{std::move(_source)} { } - bool operator==(SourceLocation const& _other) const { return source.get() == _other.source.get() && start == _other.start && end == _other.end; @@ -53,8 +49,8 @@ struct SourceLocation bool isEmpty() const { return start == -1 && end == -1; } - int start; - int end; + int start = -1; + int end = -1; std::shared_ptr<CharStream> source; }; |