Skip to content

Commit

Permalink
expected: Allow to move-assign from move-only unexpected (#40)
Browse files Browse the repository at this point in the history
Add streaming for MoveOnly.
  • Loading branch information
martinmoene committed Dec 7, 2021
1 parent b5dfa99 commit d7250c8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/expected.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ struct MoveOnly {
bool operator==( Implicit a, Implicit b ) { return a.x == b.x; }
bool operator==( Explicit a, Explicit b ) { return a.x == b.x; }

template< typename R >
bool operator==( MoveOnly const & a, R const & r ) { return a.x == r; }

std::ostream & operator<<( std::ostream & os, Implicit i ) { return os << "Implicit:" << i.x; }
std::ostream & operator<<( std::ostream & os, Explicit e ) { return os << "Explicit:" << e.x; }
std::ostream & operator<<( std::ostream & os, MoveOnly const & m ) { return os << "MoveOnly:" << m.x; }

struct InitList
{
Expand Down

0 comments on commit d7250c8

Please sign in to comment.