illegal_move_mock.cpp (539B)
1 /* 2 * Trompeloeil C++ mocking framework 3 * 4 * Copyright Björn Fahller 2019 5 * 6 * Use, modification and distribution is subject to the 7 * Boost Software License, Version 1.0. (See accompanying 8 * file LICENSE_1_0.txt or copy at 9 * http://www.boost.org/LICENSE_1_0.txt) 10 * 11 * Project home: https://github.com/rollbear/trompeloeil 12 */ 13 14 // make a mock object movable, see: 15 16 #include <trompeloeil.hpp> 17 18 19 struct M 20 { 21 MAKE_MOCK1(f, void(int)); 22 }; 23 24 template <typename T> 25 T ident(T t) 26 { 27 return t; 28 } 29 30 int main() 31 { 32 auto obj = ident(M{}); 33 }