|
Rcpp Version 0.9.10
|
00001 // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- 00002 /* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */ 00003 // 00004 // has_iterator.h: Rcpp R/C++ interface class library -- identify if a class has a nested iterator typedef 00005 // 00006 // Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois 00007 // 00008 // This file is part of Rcpp. 00009 // 00010 // Rcpp is free software: you can redistribute it and/or modify it 00011 // under the terms of the GNU General Public License as published by 00012 // the Free Software Foundation, either version 2 of the License, or 00013 // (at your option) any later version. 00014 // 00015 // Rcpp is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 // GNU General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU General Public License 00021 // along with Rcpp. If not, see <http://www.gnu.org/licenses/>. 00022 00023 #ifndef Rcpp__traits__named_object__h 00024 #define Rcpp__traits__named_object__h 00025 00026 namespace Rcpp{ 00027 class Argument ; 00028 00029 namespace traits{ 00030 00031 template <typename T> class named_object { 00032 public: 00033 named_object( const std::string& name_, const T& o_) : 00034 name(name_), object(o_){} 00035 const std::string& name ; 00036 const T& object ; 00037 } ; 00038 template <typename T> struct is_named : public false_type{} ; 00039 template <typename T> struct is_named< named_object<T> > : public true_type {} ; 00040 template <> struct is_named< Rcpp::Argument > : public true_type {} ; 00041 00042 } // namespace traits 00043 } // namespace Rcpp 00044 00045 #endif