funx <- cfunction( signature(x = "data.frame"), '
        List df(x) ;
        IntegerVector df_x = df["x"] ;
        int res = std::accumulate( df_x.begin(), df_x.end(), 0 ) ;
        return wrap(res);
', Rcpp = TRUE, includes = "using namespace Rcpp;" )
d <- data.frame( x = 1:10, y = letters[1:10] )
checkEquals( funx( d ), sum(1:10), msg = "List names based indexing" )