首页 > 其他分享 >cpp-properties调试纪要

cpp-properties调试纪要

时间:2022-10-08 15:57:19浏览次数:52  
标签:std DEPRECATED 纪要 DISABLE RESULT cpp COPY properties result

报两个错误

  1. std::result_of错误,C++20不支持,提前定义_HAS_DEPRECATED_RESULT_OF
  2. 实际用的是Qt5,不支持Q_DISABLE_COPY_MOVE,改为Q_DISABLE_COPY
// file: QtCore/qobjectdefs.h, line: 531, Qt: 5.12.5_msvc2017
template <typename Func>
static typename std::enable_if<!QtPrivate::FunctionPointer<Func>::IsPointerToMemberFunction
                               && QtPrivate::FunctionPointer<Func>::ArgumentCount == -1
                               && !std::is_convertible<Func, const char*>::value, bool>::type
invokeMethod(QObject *context, Func function, typename std::result_of<Func()>::type *ret)
{
    return invokeMethodImpl(context,
                            new QtPrivate::QFunctorSlotObjectWithNoArgs<Func, decltype(function())>(std::move(function)),
                            Qt::AutoConnection,
                            ret);
}


// file: type_traits, line: 1663
#if _HAS_DEPRECATED_RESULT_OF
template <class _Fty>
struct _CXX17_DEPRECATE_RESULT_OF result_of { // explain usage
    static_assert(_Always_false<_Fty>, "result_of<CallableType> is invalid; use "
                                       "result_of<CallableType(zero or more argument types)> instead.");
};

// file: yvals_core.h, line: 1095
#ifndef _HAS_DEPRECATED_RESULT_OF
#define _HAS_DEPRECATED_RESULT_OF (_HAS_FEATURES_REMOVED_IN_CXX20)
#endif // _HAS_DEPRECATED_RESULT_OF

// 项目属性页.配置属性.C/C++.预处理器.预处理器定义:_HAS_DEPRECATED_RESULT_OF


// qt_widgets/boolean.hpp
// Q_DISABLE_COPY_MOVE -> Q_DISABLE_COPY

// qt_widgets/integer.hpp
// Q_DISABLE_COPY_MOVE -> Q_DISABLE_COPY

// qt_widgets/nested.hpp
// Q_DISABLE_COPY_MOVE -> Q_DISABLE_COPY

创建Natvis文件

cppproperties.natvis

放在我的文档Visual Studio 2019\Visualizers

<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">

   <Type Name="tct::properties::property&lt;*&gt;">
        <DisplayString>{data}</DisplayString>
        <Expand>
            <Item Name="[data]">data</Item>
        </Expand>
    </Type>

   <!--Type Name="tct::properties::property&lt;int&gt;">
        <DisplayString>{data}</DisplayString>
        <Expand>
            <Item Name="[data]">data</Item>
        </Expand>
    </Type-->

</AutoVisualizer>

标签:std,DEPRECATED,纪要,DISABLE,RESULT,cpp,COPY,properties,result
From: https://www.cnblogs.com/octoberkey/p/16769169.html

相关文章