Skip to content

Commit 4c595eb

Browse files
committed
add missing const_SlotProxy ctor
1 parent 9dc14c7 commit 4c595eb

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2014-03-03 Kevin Ushey <[email protected]>
2+
3+
* inst/include/Rcpp/proxy/SlotProxy.h: Add missing const_SlotProxy ctor
4+
definition
5+
16
2014-02-24 Kevin Ushey <[email protected]>
27

38
* R/Rcpp.package.skeleton.R: make sure we add loadModule

inst/include/Rcpp/proxy/SlotProxy.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,12 @@ class SlotProxyPolicy {
6363

6464
class const_SlotProxy : public GenericProxy<const_SlotProxy> {
6565
public:
66-
const_SlotProxy( const CLASS& v, const std::string& name) ;
67-
const_SlotProxy& operator=(const const_SlotProxy& rhs) ;
68-
66+
const_SlotProxy( const CLASS& v, const std::string& name) : parent(v), slot_name(Rf_install(name.c_str())) {
67+
if( !R_has_slot( v, slot_name) ){
68+
throw no_such_slot() ;
69+
}
70+
}
71+
6972
template <typename T> operator T() const {
7073
return as<T>( get() );
7174
}

0 commit comments

Comments
 (0)