Example #1
0
    static type call(A0& a0, I const& indices)
    {
      Idx idx = nt2::function_index(indices, a0.extent(), meta::as_<typename A0::indexes_type>());
      std::size_t b = nt2::run(idx, 0u, meta::as_<std::size_t>());
      std::size_t e = nt2::run(idx, nt2::numel(idx.extent())-1u, meta::as_<std::size_t>())+1u;
      typename A0::value_type* p = const_cast<typename A0::value_type*>(a0.raw());

      return type(expr::make(container_ref(boost::make_shared<container>(idx.extent(), nt2::share(p+b, p+e)))));
    }
Example #2
0
    static type call(A0& a0, I const& indices)
    {
      Idx idx = nt2::function_index(indices, a0.extent(), meta::as_<typename A0::indexes_type>());
      std::size_t b = nt2::run(idx, 0u, meta::as_<std::size_t>());

      return nt2_expr(basic_expr::make(container_ref(boost::proto::value(a0), boost::proto::value(a0).begin()+b, idx.extent())));
    }