Line data Source code
1 : // Author(s): Maurice Laveaux 2 : // Copyright: see the accompanying file COPYING or copy at 3 : // https://github.com/mCRL2org/mCRL2/blob/master/COPYING 4 : // 5 : // Distributed under the Boost Software License, Version 1.0. 6 : // (See accompanying file LICENSE_1_0.txt or copy at 7 : // http://www.boost.org/LICENSE_1_0.txt) 8 : // 9 : 10 : #ifndef MCRL2_UTILITIES_WORKAROUNDS_H 11 : #define MCRL2_UTILITIES_WORKAROUNDS_H 12 : 13 : #include <algorithm> 14 : 15 : namespace mcrl2 16 : { 17 : namespace workaround 18 : { 19 : /// \brief This is a workaround for the return by value diagnostic (clang -Wreturn-std-move). 20 : /// Description: The user probably expected a move, but they're not getting a move, perhaps because 21 : /// the type of "x" is different from the return type of the function. 22 : /// \details This constraint might be lifted by newer C++ standards and then this workaround can easily be removed. 23 : template<typename T> 24 28772111 : T&& return_std_move(T& t) 25 : { 26 28772111 : return std::move(t); 27 : } 28 : } 29 : } 30 : 31 : #endif // MCRL2_UTILITIES_WORKAROUNDS_H 32 : 33 :