当前位置: 首页>>代码示例>>C++>>正文


C++ tuple类代码示例

本文整理汇总了C++中tuple的典型用法代码示例。如果您正苦于以下问题:C++ tuple类的具体用法?C++ tuple怎么用?C++ tuple使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了tuple类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: tuple

 tuple(const tuple<VValues...>& other)
    : m_head(other.head()), inherited(other.tail())
 {}
开发者ID:Barco-VCT,项目名称:VirtualClinicalTrials,代码行数:3,代码来源:variadic_templates_tools.hpp

示例2: get

 static type       get(tuple<Head, Values...>& t)      { return t.head(); }
开发者ID:Barco-VCT,项目名称:VirtualClinicalTrials,代码行数:1,代码来源:variadic_templates_tools.hpp

示例3: numgt1

inline ISAACAPI size_t numgt1(tuple const & tp)
{ return std::accumulate(tp.begin(), tp.end(), 0, [](size_t a, size_t b){ return a + (b>1); }); }
开发者ID:ngaloppo,项目名称:isaac,代码行数:2,代码来源:tuple.hpp

示例4: decltype

constexpr decltype(auto) get(tuple<T...> const& ts) {
    return *ts.unpack_into(get_impl<n>{});
}
开发者ID:KholdStare,项目名称:hana,代码行数:3,代码来源:std_tuple.cpp

示例5: min

inline ISAACAPI int_t min(tuple const & tp)
{ return std::accumulate(tp.begin(), tp.end(), std::numeric_limits<int_t>::max(), [](int_t a, int_t b){ return std::min(a, b); }); }
开发者ID:ngaloppo,项目名称:isaac,代码行数:2,代码来源:tuple.hpp

示例6: prod

inline ISAACAPI int_t prod(tuple const & tp)
{ return std::accumulate(tp.begin(), tp.end(), 1, std::multiplies<int>()); }
开发者ID:ngaloppo,项目名称:isaac,代码行数:2,代码来源:tuple.hpp

示例7:

bool operator==(const tuple<T, TTail...>& t, const tuple<U, UTail...>& u)
{
  return t.head() == u.head() && t.tail() == u.tail();
}
开发者ID:AsherBond,项目名称:MondocosmOS-Dependencies,代码行数:4,代码来源:variadic-bind.C

示例8: return

bool operator<(const tuple<T, TTail...>& t, const tuple<U, UTail...>& u)
{
  return (t.head() < u.head() || 
          (!(t.head() < u.head()) && t.tail() < u.tail()));
}
开发者ID:AsherBond,项目名称:MondocosmOS-Dependencies,代码行数:5,代码来源:variadic-bind.C

示例9: get

 static PJ get(const tuple<Head, Values...>& t) { return t.head(); }
开发者ID:AsherBond,项目名称:MondocosmOS-Dependencies,代码行数:1,代码来源:variadic-bind.C

示例10: get

std::enable_if_t<!ndt::traits<tuple_element_t<I, tuple<T...>>>::is_same_layout, tuple_element_t<I, tuple<T...>>>
get(const tuple<T...> &val) {
  return tuple_element_t<I, tuple<T...>>(val.metadata() + sizeof...(T) * sizeof(uintptr_t),
                                         val.data() + val.template offset<I>());
}
开发者ID:yochju,项目名称:libdynd,代码行数:5,代码来源:tuple_type.hpp

示例11: to_std_tuple

			std::tuple<A,B...> to_std_tuple(){
				return std::tuple_cat(std::make_tuple(a),rest.to_std_tuple());
			}
开发者ID:mpmilano,项目名称:mutils,代码行数:3,代码来源:compile-time-tuple.hpp

示例12: operator

 bool operator()(const tuple<Alloc>& a) const { return a.match(m_pattern, m_binding); }
开发者ID:alepharchives,项目名称:eixx,代码行数:1,代码来源:visit_match.hpp


注:本文中的tuple类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。