forked from qt-creator/qt-creator
debugger: add dumper for boost::optional
This commit is contained in:
@@ -2066,6 +2066,23 @@ def qdump____gnu_cxx__hash_set(d, item):
|
||||
itemCount += 1
|
||||
p = p + 1
|
||||
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# Boost dumper
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
def qdump__boost__optional(d, item):
|
||||
if item.value["m_initialized"] == False:
|
||||
d.putValue("<uninitialized>")
|
||||
d.putNumChild(0)
|
||||
else:
|
||||
d.putType(item.value.type, d.currentTypePriority + 1)
|
||||
type = item.value.type.template_argument(0)
|
||||
d.putItemHelper(Item(item.value["m_storage"].cast(type), item.iname))
|
||||
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# Symbian
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
TARGET = boost
|
||||
CONFIG += qt
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += .
|
||||
SOURCES += main.cpp
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
using namespace boost;
|
||||
|
||||
struct Large
|
||||
{
|
||||
Large() { d1 = d2 = d3 = d4 = d5 = 0; }
|
||||
|
||||
double d1;
|
||||
double d2;
|
||||
double d3;
|
||||
double d4;
|
||||
double d5;
|
||||
};
|
||||
|
||||
void testOptional()
|
||||
{
|
||||
optional<int> i;
|
||||
optional<double> d;
|
||||
optional<Large> l;
|
||||
i = 1;
|
||||
l = Large();
|
||||
i = 2;
|
||||
i = 3;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
testOptional();
|
||||
}
|
||||
Reference in New Issue
Block a user