Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:05

0001 
0002 //              Copyright Catch2 Authors
0003 // Distributed under the Boost Software License, Version 1.0.
0004 //   (See accompanying file LICENSE.txt or copy at
0005 //        https://www.boost.org/LICENSE_1_0.txt)
0006 
0007 // SPDX-License-Identifier: BSL-1.0
0008 #ifndef CATCH_LAZY_EXPR_HPP_INCLUDED
0009 #define CATCH_LAZY_EXPR_HPP_INCLUDED
0010 
0011 #include <iosfwd>
0012 
0013 namespace Catch {
0014 
0015     class ITransientExpression;
0016 
0017     class LazyExpression {
0018         friend class AssertionHandler;
0019         friend struct AssertionStats;
0020         friend class RunContext;
0021 
0022         ITransientExpression const* m_transientExpression = nullptr;
0023         bool m_isNegated;
0024     public:
0025         LazyExpression( bool isNegated ):
0026             m_isNegated(isNegated)
0027         {}
0028         LazyExpression(LazyExpression const& other) = default;
0029         LazyExpression& operator = ( LazyExpression const& ) = delete;
0030 
0031         explicit operator bool() const {
0032             return m_transientExpression != nullptr;
0033         }
0034 
0035         friend auto operator << ( std::ostream& os, LazyExpression const& lazyExpr ) -> std::ostream&;
0036     };
0037 
0038 } // namespace Catch
0039 
0040 #endif // CATCH_LAZY_EXPR_HPP_INCLUDED