RcppR6
RcppR6 copied to clipboard
S3 dispatch for templated constructors
For the case where the a class is templated on T and the constructor has args [name: T] then we should be able to dispatch on the class of T rather than forcing through the manual class selection. So rather than having to write:
constructor("classname")(object)
this should work:
constructor(object)
which could just work by making constructor generic and adding methods for the rest. In general, this would be allowable if the first argument to the constructor is T, regardless of how many parameters there are. Perhaps add a flag: s3generic: true to the YAML to trigger this?