diff --git a/SConstruct b/SConstruct index bc057ada7e..f944d7799c 100644 --- a/SConstruct +++ b/SConstruct @@ -100,7 +100,7 @@ BOOSTFLAGS = ['-DBOOST_TEST_DYN_LINK', '-DBOOST_FILESYSTEM_NO_DEPRECATED'] env.Append(LINKFLAGS = ['-rdynamic', '-pthread']) env.Append(CCFLAGS = ['-pthread', '-Wall', '-Wno-sign-compare', '-Wno-char-subscripts', '-DSQLITE_THREADSAFE=1']) -env.Append(CXXFLAGS = ['-O0', '-pthread', '-Wno-invalid-offsetof', '-Wformat']+BOOSTFLAGS+DEBUGFLAGS) +env.Append(CXXFLAGS = ['-O0', '-std=c++11', '-pthread', '-Wno-invalid-offsetof', '-Wformat']+BOOSTFLAGS+DEBUGFLAGS) if OSX: env.Append(LINKFLAGS = ['-L/usr/local/opt/openssl/lib']) diff --git a/src/cpp/ripple/Amount.cpp b/src/cpp/ripple/Amount.cpp index 9b9530eb7c..2232fae789 100644 --- a/src/cpp/ripple/Amount.cpp +++ b/src/cpp/ripple/Amount.cpp @@ -1187,7 +1187,7 @@ STAmount STAmount::getPay(const STAmount& offerOut, const STAmount& offerIn, con STAmount STAmount::deserialize(SerializerIterator& it) { - std::auto_ptr s(dynamic_cast(construct(it, sfGeneric))); + UPTR_T s(dynamic_cast(construct(it, sfGeneric))); STAmount ret(*s); return ret; } diff --git a/src/cpp/ripple/HashedObject.cpp b/src/cpp/ripple/HashedObject.cpp index 91f98d751d..aea25c3b0f 100644 --- a/src/cpp/ripple/HashedObject.cpp +++ b/src/cpp/ripple/HashedObject.cpp @@ -261,7 +261,7 @@ HashedObject::pointer HashedObjectStore::retrieve(const uint256& hash) int HashedObjectStore::import(const std::string& file) { cLog(lsWARNING) << "Hash import from \"" << file << "\"."; - std::auto_ptr importDB(new SqliteDatabase(file.c_str())); + UPTR_T importDB(new SqliteDatabase(file.c_str())); importDB->connect(); int countYes = 0, countNo = 0; diff --git a/src/cpp/ripple/LoadMonitor.h b/src/cpp/ripple/LoadMonitor.h index db662b9c91..f97c2fb3c7 100644 --- a/src/cpp/ripple/LoadMonitor.h +++ b/src/cpp/ripple/LoadMonitor.h @@ -6,7 +6,9 @@ #include #include +#include "utils.h" #include "types.h" + extern int upTime(); // Monitors load levels and response times @@ -54,7 +56,7 @@ class LoadEvent { public: typedef boost::shared_ptr pointer; - typedef std::auto_ptr autoptr; + typedef UPTR_T autoptr; protected: LoadMonitor& mMonitor; diff --git a/src/cpp/ripple/RPCHandler.cpp b/src/cpp/ripple/RPCHandler.cpp index 280a0ccb38..d642e05e40 100644 --- a/src/cpp/ripple/RPCHandler.cpp +++ b/src/cpp/ripple/RPCHandler.cpp @@ -270,7 +270,7 @@ Json::Value RPCHandler::transactionSign(Json::Value jvRequest, bool bSubmit) return rpcError(rpcSRC_ACT_NOT_FOUND); } - std::auto_ptr sopTrans; + UPTR_T sopTrans; try { diff --git a/src/cpp/ripple/SerializedObject.cpp b/src/cpp/ripple/SerializedObject.cpp index bf8ee43265..497b2fb7db 100644 --- a/src/cpp/ripple/SerializedObject.cpp +++ b/src/cpp/ripple/SerializedObject.cpp @@ -17,56 +17,56 @@ SETUP_LOG(); DECLARE_INSTANCE(SerializedObject); DECLARE_INSTANCE(SerializedArray); -std::auto_ptr STObject::makeDefaultObject(SerializedTypeID id, SField::ref name) +UPTR_T STObject::makeDefaultObject(SerializedTypeID id, SField::ref name) { assert((id == STI_NOTPRESENT) || (id == name.fieldType)); switch(id) { case STI_NOTPRESENT: - return std::auto_ptr(new SerializedType(name)); + return UPTR_T(new SerializedType(name)); case STI_UINT8: - return std::auto_ptr(new STUInt8(name)); + return UPTR_T(new STUInt8(name)); case STI_UINT16: - return std::auto_ptr(new STUInt16(name)); + return UPTR_T(new STUInt16(name)); case STI_UINT32: - return std::auto_ptr(new STUInt32(name)); + return UPTR_T(new STUInt32(name)); case STI_UINT64: - return std::auto_ptr(new STUInt64(name)); + return UPTR_T(new STUInt64(name)); case STI_AMOUNT: - return std::auto_ptr(new STAmount(name)); + return UPTR_T(new STAmount(name)); case STI_HASH128: - return std::auto_ptr(new STHash128(name)); + return UPTR_T(new STHash128(name)); case STI_HASH160: - return std::auto_ptr(new STHash160(name)); + return UPTR_T(new STHash160(name)); case STI_HASH256: - return std::auto_ptr(new STHash256(name)); + return UPTR_T(new STHash256(name)); case STI_VECTOR256: - return std::auto_ptr(new STVector256(name)); + return UPTR_T(new STVector256(name)); case STI_VL: - return std::auto_ptr(new STVariableLength(name)); + return UPTR_T(new STVariableLength(name)); case STI_ACCOUNT: - return std::auto_ptr(new STAccount(name)); + return UPTR_T(new STAccount(name)); case STI_PATHSET: - return std::auto_ptr(new STPathSet(name)); + return UPTR_T(new STPathSet(name)); case STI_OBJECT: - return std::auto_ptr(new STObject(name)); + return UPTR_T(new STObject(name)); case STI_ARRAY: - return std::auto_ptr(new STArray(name)); + return UPTR_T(new STArray(name)); default: cLog(lsFATAL) << "Object type: " << lexical_cast_i(id); @@ -75,7 +75,7 @@ std::auto_ptr STObject::makeDefaultObject(SerializedTypeID id, S } } -std::auto_ptr STObject::makeDeserializedObject(SerializedTypeID id, SField::ref name, +UPTR_T STObject::makeDeserializedObject(SerializedTypeID id, SField::ref name, SerializerIterator& sit, int depth) { switch(id) @@ -192,7 +192,7 @@ bool STObject::setType(const SOTemplate &type) << elem->e_field.fieldName; valid = false; } - newData.push_back(makeNonPresentObject(elem->e_field)); + newData.push_back(makeNonPresentObject(elem->e_field).release()); } } @@ -252,10 +252,10 @@ bool STObject::set(SerializerIterator& sit, int depth) return false; } -std::auto_ptr STObject::deserialize(SerializerIterator& sit, SField::ref name) +UPTR_T STObject::deserialize(SerializerIterator& sit, SField::ref name) { STObject *o; - std::auto_ptr object(o = new STObject(name)); + UPTR_T object(o = new STObject(name)); o->set(sit, 1); return object; } @@ -482,7 +482,7 @@ SerializedType* STObject::makeFieldPresent(SField::ref field) SerializedType* f = getPIndex(index); if (f->getSType() != STI_NOTPRESENT) return f; - mData.replace(index, makeDefaultObject(f->getFName())); + mData.replace(index, makeDefaultObject(f->getFName()).release()); return getPIndex(index); } @@ -496,7 +496,7 @@ void STObject::makeFieldAbsent(SField::ref field) if (f.getSType() == STI_NOTPRESENT) return; - mData.replace(index, makeNonPresentObject(f.getFName())); + mData.replace(index, makeNonPresentObject(f.getFName()).release()); } bool STObject::delField(SField::ref field) @@ -957,7 +957,7 @@ void STArray::sort(bool (*compare)(const STObject&, const STObject&)) value.sort(compare); } -std::auto_ptr STObject::parseJson(const Json::Value& object, SField::ref inName, int depth) +UPTR_T STObject::parseJson(const Json::Value& object, SField::ref inName, int depth) { if (!object.isObject()) throw std::runtime_error("Value is not an object"); @@ -1219,7 +1219,7 @@ std::auto_ptr STObject::parseJson(const Json::Value& object, SField::r throw std::runtime_error("Inner value is not an object"); if (depth > 64) throw std::runtime_error("Json nest depth exceeded"); - data.push_back(parseJson(value, field, depth + 1)); + data.push_back(parseJson(value, field, depth + 1).release()); break; case STI_ARRAY: @@ -1238,7 +1238,7 @@ std::auto_ptr STObject::parseJson(const Json::Value& object, SField::r } } - return std::auto_ptr(new STObject(*name, data)); + return UPTR_T(new STObject(*name, data)); } BOOST_AUTO_TEST_SUITE(SerializedObject) diff --git a/src/cpp/ripple/SerializedObject.h b/src/cpp/ripple/SerializedObject.h index 8638d4e9e8..67d76fabdf 100644 --- a/src/cpp/ripple/SerializedObject.h +++ b/src/cpp/ripple/SerializedObject.h @@ -58,13 +58,13 @@ public: STObject(const SOTemplate& type, SerializerIterator& sit, SField::ref name) : SerializedType(name) { set(sit); setType(type); } - std::auto_ptr oClone() const { return std::auto_ptr(new STObject(*this)); } + UPTR_T oClone() const { return UPTR_T(new STObject(*this)); } - static std::auto_ptr parseJson(const Json::Value& value, SField::ref name = sfGeneric, int depth = 0); + static UPTR_T parseJson(const Json::Value& value, SField::ref name = sfGeneric, int depth = 0); virtual ~STObject() { ; } - static std::auto_ptr deserialize(SerializerIterator& sit, SField::ref name); + static UPTR_T deserialize(SerializerIterator& sit, SField::ref name); bool setType(const SOTemplate& type); bool isValidForType(); @@ -85,8 +85,8 @@ public: std::string getText() const; virtual Json::Value getJson(int options) const; - int addObject(const SerializedType& t) { mData.push_back(t.clone()); return mData.size() - 1; } - int giveObject(std::auto_ptr t) { mData.push_back(t); return mData.size() - 1; } + int addObject(const SerializedType& t) { mData.push_back(t.clone().release()); return mData.size() - 1; } + int giveObject(UPTR_T t) { mData.push_back(t.release()); return mData.size() - 1; } int giveObject(SerializedType* t) { mData.push_back(t); return mData.size() - 1; } const boost::ptr_vector& peekData() const { return mData; } boost::ptr_vector& peekData() { return mData; } @@ -157,13 +157,13 @@ public: bool delField(SField::ref field); void delField(int index); - static std::auto_ptr makeDefaultObject(SerializedTypeID id, SField::ref name); - static std::auto_ptr makeDeserializedObject(SerializedTypeID id, SField::ref name, + static UPTR_T makeDefaultObject(SerializedTypeID id, SField::ref name); + static UPTR_T makeDeserializedObject(SerializedTypeID id, SField::ref name, SerializerIterator&, int depth); - static std::auto_ptr makeNonPresentObject(SField::ref name) + static UPTR_T makeNonPresentObject(SField::ref name) { return makeDefaultObject(STI_NOTPRESENT, name); } - static std::auto_ptr makeDefaultObject(SField::ref name) + static UPTR_T makeDefaultObject(SField::ref name) { return makeDefaultObject(name.fieldType, name); } // field iterator stuff @@ -221,14 +221,14 @@ public: STArray(SField::ref f, const vector& v) : SerializedType(f), value(v) { ; } STArray(vector& v) : value(v) { ; } - static std::auto_ptr deserialize(SerializerIterator& sit, SField::ref name) - { return std::auto_ptr(construct(sit, name)); } + static UPTR_T deserialize(SerializerIterator& sit, SField::ref name) + { return UPTR_T(construct(sit, name)); } const vector& getValue() const { return value; } vector& getValue() { return value; } // vector-like functions - void push_back(const STObject& object) { value.push_back(object.oClone()); } + void push_back(const STObject& object) { value.push_back(object.oClone().release()); } STObject& operator[](int j) { return value[j]; } const STObject& operator[](int j) const { return value[j]; } iterator begin() { return value.begin(); } diff --git a/src/cpp/ripple/SerializedTransaction.cpp b/src/cpp/ripple/SerializedTransaction.cpp index c5a1d1445f..e79b3f6a5b 100644 --- a/src/cpp/ripple/SerializedTransaction.cpp +++ b/src/cpp/ripple/SerializedTransaction.cpp @@ -305,7 +305,7 @@ BOOST_AUTO_TEST_CASE( STrans_test ) Log(lsFATAL) << copy.getJson(0); BOOST_FAIL("Transaction fails serialize/deserialize test"); } - std::auto_ptr new_obj = STObject::parseJson(j.getJson(0), sfGeneric); + UPTR_T new_obj = STObject::parseJson(j.getJson(0), sfGeneric); if (new_obj.get() == NULL) BOOST_FAIL("Unable to build object from json"); if (STObject(j) != *new_obj) diff --git a/src/cpp/ripple/SerializedTypes.cpp b/src/cpp/ripple/SerializedTypes.cpp index 3b5b752290..2e6cf1d472 100644 --- a/src/cpp/ripple/SerializedTypes.cpp +++ b/src/cpp/ripple/SerializedTypes.cpp @@ -286,7 +286,7 @@ STVector256* STVector256::construct(SerializerIterator& u, SField::ref name) { std::vector data = u.getVL(); - std::auto_ptr vec(new STVector256(name)); + UPTR_T vec(new STVector256(name)); int count = data.size() / (256 / 8); vec->mValue.reserve(count); diff --git a/src/cpp/ripple/SerializedTypes.h b/src/cpp/ripple/SerializedTypes.h index 30cb3b8fb2..96306a79f2 100644 --- a/src/cpp/ripple/SerializedTypes.h +++ b/src/cpp/ripple/SerializedTypes.h @@ -58,15 +58,15 @@ public: SerializedType(SField::ref n) : fName(&n) { assert(fName); } virtual ~SerializedType() { ; } - static std::auto_ptr deserialize(SField::ref name) - { return std::auto_ptr(new SerializedType(name)); } + static UPTR_T deserialize(SField::ref name) + { return UPTR_T(new SerializedType(name)); } void setFName(SField::ref n) { fName = &n; assert(fName); } SField::ref getFName() const { return *fName; } std::string getName() const { return fName->fieldName; } virtual SerializedTypeID getSType() const { return STI_NOTPRESENT; } - std::auto_ptr clone() const { return std::auto_ptr(duplicate()); } + UPTR_T clone() const { return UPTR_T(duplicate()); } virtual std::string getFullText() const; virtual std::string getText() const // just the value @@ -107,8 +107,8 @@ public: STUInt8(unsigned char v = 0) : value(v) { ; } STUInt8(SField::ref n, unsigned char v = 0) : SerializedType(n), value(v) { ; } - static std::auto_ptr deserialize(SerializerIterator& sit, SField::ref name) - { return std::auto_ptr(construct(sit, name)); } + static UPTR_T deserialize(SerializerIterator& sit, SField::ref name) + { return UPTR_T(construct(sit, name)); } SerializedTypeID getSType() const { return STI_UINT8; } std::string getText() const; @@ -135,8 +135,8 @@ public: STUInt16(uint16 v = 0) : value(v) { ; } STUInt16(SField::ref n, uint16 v = 0) : SerializedType(n), value(v) { ; } - static std::auto_ptr deserialize(SerializerIterator& sit, SField::ref name) - { return std::auto_ptr(construct(sit, name)); } + static UPTR_T deserialize(SerializerIterator& sit, SField::ref name) + { return UPTR_T(construct(sit, name)); } SerializedTypeID getSType() const { return STI_UINT16; } std::string getText() const; @@ -163,8 +163,8 @@ public: STUInt32(uint32 v = 0) : value(v) { ; } STUInt32(SField::ref n, uint32 v = 0) : SerializedType(n), value(v) { ; } - static std::auto_ptr deserialize(SerializerIterator& sit, SField::ref name) - { return std::auto_ptr(construct(sit, name)); } + static UPTR_T deserialize(SerializerIterator& sit, SField::ref name) + { return UPTR_T(construct(sit, name)); } SerializedTypeID getSType() const { return STI_UINT32; } std::string getText() const; @@ -191,8 +191,8 @@ public: STUInt64(uint64 v = 0) : value(v) { ; } STUInt64(SField::ref n, uint64 v = 0) : SerializedType(n), value(v) { ; } - static std::auto_ptr deserialize(SerializerIterator& sit, SField::ref name) - { return std::auto_ptr(construct(sit, name)); } + static UPTR_T deserialize(SerializerIterator& sit, SField::ref name) + { return UPTR_T(construct(sit, name)); } SerializedTypeID getSType() const { return STI_UINT64; } std::string getText() const; @@ -331,8 +331,8 @@ public: static STAmount createFromInt64(SField::ref n, int64 v); - static std::auto_ptr deserialize(SerializerIterator& sit, SField::ref name) - { return std::auto_ptr(construct(sit, name)); } + static UPTR_T deserialize(SerializerIterator& sit, SField::ref name) + { return UPTR_T(construct(sit, name)); } bool bSetJson(const Json::Value& jvSource); @@ -493,8 +493,8 @@ public: STHash128(SField::ref n, const std::string &v) : SerializedType(n) { value.SetHex(v); } STHash128(SField::ref n) : SerializedType(n) { ; } STHash128() { ; } - static std::auto_ptr deserialize(SerializerIterator& sit, SField::ref name) - { return std::auto_ptr(construct(sit, name)); } + static UPTR_T deserialize(SerializerIterator& sit, SField::ref name) + { return UPTR_T(construct(sit, name)); } SerializedTypeID getSType() const { return STI_HASH128; } virtual std::string getText() const; @@ -524,8 +524,8 @@ public: STHash160(SField::ref n, const std::string &v) : SerializedType(n) { value.SetHex(v); } STHash160(SField::ref n) : SerializedType(n) { ; } STHash160() { ; } - static std::auto_ptr deserialize(SerializerIterator& sit, SField::ref name) - { return std::auto_ptr(construct(sit, name)); } + static UPTR_T deserialize(SerializerIterator& sit, SField::ref name) + { return UPTR_T(construct(sit, name)); } SerializedTypeID getSType() const { return STI_HASH160; } virtual std::string getText() const; @@ -555,8 +555,8 @@ public: STHash256(SField::ref n, const std::string &v) : SerializedType(n) { value.SetHex(v); } STHash256(SField::ref n) : SerializedType(n) { ; } STHash256() { ; } - static std::auto_ptr deserialize(SerializerIterator& sit, SField::ref name) - { return std::auto_ptr(construct(sit, name)); } + static UPTR_T deserialize(SerializerIterator& sit, SField::ref name) + { return UPTR_T(construct(sit, name)); } SerializedTypeID getSType() const { return STI_HASH256; } std::string getText() const; @@ -585,8 +585,8 @@ public: STVariableLength(SField::ref n) : SerializedType(n) { ; } STVariableLength(SerializerIterator&, SField::ref name = sfGeneric); STVariableLength() { ; } - static std::auto_ptr deserialize(SerializerIterator& sit, SField::ref name) - { return std::auto_ptr(construct(sit, name)); } + static UPTR_T deserialize(SerializerIterator& sit, SField::ref name) + { return UPTR_T(construct(sit, name)); } virtual SerializedTypeID getSType() const { return STI_VL; } virtual std::string getText() const; @@ -615,8 +615,8 @@ public: STAccount(SField::ref n, const uint160& v); STAccount(SField::ref n) : STVariableLength(n) { ; } STAccount() { ; } - static std::auto_ptr deserialize(SerializerIterator& sit, SField::ref name) - { return std::auto_ptr(construct(sit, name)); } + static UPTR_T deserialize(SerializerIterator& sit, SField::ref name) + { return UPTR_T(construct(sit, name)); } SerializedTypeID getSType() const { return STI_ACCOUNT; } std::string getText() const; @@ -770,8 +770,8 @@ public: STPathSet(SField::ref n) : SerializedType(n) { ; } STPathSet(const std::vector& v) : value(v) { ; } STPathSet(SField::ref n, const std::vector& v) : SerializedType(n), value(v) { ; } - static std::auto_ptr deserialize(SerializerIterator& sit, SField::ref name) - { return std::auto_ptr(construct(sit, name)); } + static UPTR_T deserialize(SerializerIterator& sit, SField::ref name) + { return UPTR_T(construct(sit, name)); } // std::string getText() const; void add(Serializer& s) const; @@ -848,8 +848,8 @@ public: SerializedTypeID getSType() const { return STI_VECTOR256; } void add(Serializer& s) const; - static std::auto_ptr deserialize(SerializerIterator& sit, SField::ref name) - { return std::auto_ptr(construct(sit, name)); } + static UPTR_T deserialize(SerializerIterator& sit, SField::ref name) + { return UPTR_T(construct(sit, name)); } const std::vector& peekValue() const { return mValue; } std::vector& peekValue() { return mValue; } diff --git a/src/cpp/ripple/TransactionEngine.cpp b/src/cpp/ripple/TransactionEngine.cpp index a14f9e346f..1e0beac41d 100644 --- a/src/cpp/ripple/TransactionEngine.cpp +++ b/src/cpp/ripple/TransactionEngine.cpp @@ -93,7 +93,7 @@ TER TransactionEngine::applyTransaction(const SerializedTransaction& txn, Transa } #endif - std::auto_ptr transactor = Transactor::makeTransactor(txn,params,this); + UPTR_T transactor = Transactor::makeTransactor(txn,params,this); if (transactor.get() != NULL) { uint256 txID = txn.getTransactionID(); diff --git a/src/cpp/ripple/TransactionMeta.cpp b/src/cpp/ripple/TransactionMeta.cpp index 99ea1e4c38..0f7bab5b25 100644 --- a/src/cpp/ripple/TransactionMeta.cpp +++ b/src/cpp/ripple/TransactionMeta.cpp @@ -17,7 +17,7 @@ TransactionMetaSet::TransactionMetaSet(const uint256& txid, uint32 ledger, const Serializer s(vec); SerializerIterator sit(s); - std::auto_ptr pobj = STObject::deserialize(sit, sfAffectedNodes); + UPTR_T pobj = STObject::deserialize(sit, sfAffectedNodes); STObject *obj = static_cast(pobj.get()); if (!obj) throw std::runtime_error("bad metadata"); diff --git a/src/cpp/ripple/Transactor.cpp b/src/cpp/ripple/Transactor.cpp index 4b65dd7fdb..7534546d54 100644 --- a/src/cpp/ripple/Transactor.cpp +++ b/src/cpp/ripple/Transactor.cpp @@ -11,26 +11,26 @@ SETUP_LOG(); -std::auto_ptr Transactor::makeTransactor(const SerializedTransaction& txn,TransactionEngineParams params, TransactionEngine* engine) +UPTR_T Transactor::makeTransactor(const SerializedTransaction& txn,TransactionEngineParams params, TransactionEngine* engine) { switch(txn.getTxnType()) { case ttPAYMENT: - return std::auto_ptr(new PaymentTransactor(txn, params, engine)); + return UPTR_T(new PaymentTransactor(txn, params, engine)); case ttACCOUNT_SET: - return std::auto_ptr(new AccountSetTransactor(txn, params, engine)); + return UPTR_T(new AccountSetTransactor(txn, params, engine)); case ttREGULAR_KEY_SET: - return std::auto_ptr(new RegularKeySetTransactor(txn, params, engine)); + return UPTR_T(new RegularKeySetTransactor(txn, params, engine)); case ttTRUST_SET: - return std::auto_ptr(new TrustSetTransactor(txn, params, engine)); + return UPTR_T(new TrustSetTransactor(txn, params, engine)); case ttOFFER_CREATE: - return std::auto_ptr(new OfferCreateTransactor(txn, params, engine)); + return UPTR_T(new OfferCreateTransactor(txn, params, engine)); case ttOFFER_CANCEL: - return std::auto_ptr(new OfferCancelTransactor(txn, params, engine)); + return UPTR_T(new OfferCancelTransactor(txn, params, engine)); case ttWALLET_ADD: - return std::auto_ptr(new WalletAddTransactor(txn, params, engine)); + return UPTR_T(new WalletAddTransactor(txn, params, engine)); default: - return std::auto_ptr(); + return UPTR_T(); } } diff --git a/src/cpp/ripple/Transactor.h b/src/cpp/ripple/Transactor.h index 8a2d276d34..f530b6f9c1 100644 --- a/src/cpp/ripple/Transactor.h +++ b/src/cpp/ripple/Transactor.h @@ -1,10 +1,11 @@ #ifndef __TRANSACTOR__ #define __TRANSACTOR__ +#include + #include "SerializedTransaction.h" #include "TransactionErr.h" #include "TransactionEngine.h" -#include class Transactor { @@ -38,7 +39,7 @@ protected: public: typedef boost::shared_ptr pointer; - static std::auto_ptr makeTransactor(const SerializedTransaction& txn,TransactionEngineParams params, TransactionEngine* engine); + static UPTR_T makeTransactor(const SerializedTransaction& txn,TransactionEngineParams params, TransactionEngine* engine); TER apply(); }; diff --git a/src/cpp/ripple/utils.h b/src/cpp/ripple/utils.h index 77ae2f26fd..9938a26d35 100644 --- a/src/cpp/ripple/utils.h +++ b/src/cpp/ripple/utils.h @@ -286,6 +286,19 @@ template T range_check_cast(const U& value, const T& min bool parseUrl(const std::string& strUrl, std::string& strScheme, std::string& strDomain, int& iPort, std::string& strPath); +#if (!defined(FORCE_NO_C11X) && (__cplusplus > 201100L)) || defined(FORCE_C11X) + +#define C11X +#define UPTR_T std::unique_ptr +#define MOVE_P(p) std::move(p) + +#else + +#define UPTR_T std::auto_ptr +#define MOVE_P(p) (p) + +#endif + #endif // vim:ts=4