Mercurial > hg > orthanc-databases
comparison Framework/Common/ResultBase.cpp @ 157:275e14f57f1e
replacing deprecated std::auto_ptr by std::unique_ptr
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 06 Jul 2020 12:45:58 +0200 |
parents | 063aa53b5917 |
children | 3236894320d6 |
comparison
equal
deleted
inserted
replaced
156:710537acb488 | 157:275e14f57f1e |
---|---|
24 #include "../Common/BinaryStringValue.h" | 24 #include "../Common/BinaryStringValue.h" |
25 #include "../Common/Integer64Value.h" | 25 #include "../Common/Integer64Value.h" |
26 #include "../Common/NullValue.h" | 26 #include "../Common/NullValue.h" |
27 #include "../Common/Utf8StringValue.h" | 27 #include "../Common/Utf8StringValue.h" |
28 | 28 |
29 #include <Compatibility.h> // For std::unique_ptr<> | |
29 #include <Logging.h> | 30 #include <Logging.h> |
30 #include <OrthancException.h> | 31 #include <OrthancException.h> |
31 | 32 |
32 #include <cassert> | 33 #include <cassert> |
33 #include <memory> | 34 #include <memory> |
64 | 65 |
65 if (hasExpectedType_[i] && | 66 if (hasExpectedType_[i] && |
66 sourceType != ValueType_Null && | 67 sourceType != ValueType_Null && |
67 sourceType != targetType) | 68 sourceType != targetType) |
68 { | 69 { |
69 std::auto_ptr<IValue> converted(fields_[i]->Convert(targetType)); | 70 std::unique_ptr<IValue> converted(fields_[i]->Convert(targetType)); |
70 | 71 |
71 if (converted.get() == NULL) | 72 if (converted.get() == NULL) |
72 { | 73 { |
73 LOG(ERROR) << "Cannot convert between data types from a database"; | 74 LOG(ERROR) << "Cannot convert between data types from a database"; |
74 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadParameterType); | 75 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadParameterType); |