Skip to content
This repository has been archived by the owner on Jan 15, 2020. It is now read-only.
This repository has been archived by the owner on Jan 15, 2020. It is now read-only.

Duplicate copy constructors for binary::decode and binary::encode #3

Open
Niadb opened this issue Sep 3, 2019 · 0 comments
Open

Duplicate copy constructors for binary::decode and binary::encode #3

Niadb opened this issue Sep 3, 2019 · 0 comments

Comments

@Niadb
Copy link

Niadb commented Sep 3, 2019

MSVC trips up here giving a warning that there are duplicate copy constructors for both decode and encode.

decoder(const decoder&);
decoder(decoder&);

inline
decoder::decoder(const decoder& d)
: _was_error(d._was_error) {
_current.begin = d._current.begin;
_current.end = d._current.end;
}

inline
decoder::decoder(decoder& d)
: _was_error(d._was_error) {
_current.begin = d._current.begin;
_current.end = d._current.end;
}
They are identical so we can remove the non-const versions-- and the problem goes away

EDIT: I see why you were doing this-- the compiler is invoking the wrong copy constructor in encode(encode), and calling the Sequence instead..

Guess the only solution is to disable this warning.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant