Skip to content

Commit 5f1c8f4

Browse files
Dead code removal.
1 parent 09be88a commit 5f1c8f4

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

RESTProcess_base.h

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ namespace classdesc
6565
/// @}
6666
/// true if this is an object, not a function
6767
virtual bool isObject() const {return false;}
68-
/// if this is a reference object, then convert this to a value object. Otherwise, return null
69-
virtual RPPtr toValue() const {return nullptr;}
7068
/// true if this is a const object, a const member function or static/free function
7169
virtual bool isConst() const {return false;}
7270
/// arity if this is a function, 0 otherwise
@@ -480,7 +478,6 @@ namespace classdesc
480478
bool isObject() const override {return true;}
481479
const object* getConstClassdescObject() override {return getClassdescObjectImpl(obj);}
482480
bool isConst() const override {return std::is_const<T>::value;}
483-
RPPtr toValue() const override {return toObjectValueImpl(*this);}
484481
};
485482

486483
/// same as \a RESTProcessObject, but internally stores the object. T must be copy constructible or moveable
@@ -490,7 +487,6 @@ namespace classdesc
490487
public:
491488
template <class... Args>
492489
RESTProcessValueObject(Args&&... args): RESTProcessObject<T>(actual), actual(std::forward<Args>(args)...) {}
493-
RPPtr toValue() const override {return nullptr;}
494490
};
495491

496492
template <class T> inline
@@ -690,7 +686,6 @@ namespace classdesc
690686
RESTProcess_t list() const override;
691687
std::string type() const override {return typeName<T>();}
692688
REST_PROCESS_BUFFER asBuffer() const override {REST_PROCESS_BUFFER r; return r<<obj;}
693-
RPPtr toValue() const override;
694689
bool isObject() const override {return true;}
695690
RPPtr getElem(const REST_PROCESS_BUFFER& index) {
696691
size_t idx; index>>idx;
@@ -716,7 +711,6 @@ namespace classdesc
716711
public:
717712
template <class... Args>
718713
RESTProcessValueSequence(Args&&... args): RESTProcessSequence<T>(actual), actual(std::forward<Args>(args)...) {}
719-
RPPtr toValue() const override {return nullptr;}
720714
};
721715

722716
template <class T> struct RESTProcessMultiArray: public RESTProcessBase
@@ -771,14 +765,10 @@ namespace classdesc
771765
return std::make_shared<RESTProcessObject<T>>(v);
772766
}
773767
size_t size() const override {return actual.size();}
774-
RPPtr toValue() const override {return nullptr;}
775768
};
776769

777770

778771

779-
template <class T> RPPtr RESTProcessSequence<T>::toValue() const
780-
{return std::make_shared<RESTProcessValueSequence<T>>(obj);}
781-
782772
template <class T>
783773
typename enable_if<
784774
And<
@@ -933,7 +923,6 @@ namespace classdesc
933923
RESTProcess_t list() const override;
934924
std::string type() const override {return typeName<T>();}
935925
REST_PROCESS_BUFFER asBuffer() const override {REST_PROCESS_BUFFER r; return r<<obj;}
936-
RPPtr toValue() const override;
937926
bool isObject() const override {return true;}
938927
RPPtr getElem(const REST_PROCESS_BUFFER& index) {
939928
typename T::key_type idx; index>>idx;
@@ -967,12 +956,8 @@ namespace classdesc
967956
template <class... Args>
968957
RESTProcessValueAssociativeContainer(Args&&... args):
969958
RESTProcessAssociativeContainer<T>(actual), actual(std::forward<Args>(args)...) {}
970-
RPPtr toValue() const override {return nullptr;}
971959
};
972960

973-
template <class T> RPPtr RESTProcessAssociativeContainer<T>::toValue() const
974-
{return std::make_shared<RESTProcessValueAssociativeContainer<T>>(obj);}
975-
976961
template <class T>
977962
typename enable_if<is_associative_container<T>, void>::T
978963
RESTProcessp(RESTProcess_t& repo, const string& d, T& a)
@@ -1137,9 +1122,7 @@ namespace classdesc
11371122
return makeRESTProcessValueObject(std::move(r));
11381123
RESTProcess_t map;
11391124
RESTProcess(map,"",r);
1140-
auto rp=map.process(remainder, arguments);
1141-
if (auto v=rp->toValue()) return v; // create a copy of the return value
1142-
return rp;
1125+
return map.process(remainder, arguments);
11431126
}
11441127

11451128
template <class F>

test/testRef.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
#include "poly.h"
10-
//#include "ref.cd"
1110
#include "testRef.h"
1211
#include "testRef.cd"
1312
#include "classdesc_epilogue.h"

0 commit comments

Comments
 (0)