Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about fold-expression

Read more about fold-expression

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - fold-expression

C++17 can variadic template class define new type and variadic data member?

#include <iostream> template <typename T0, typename T1> struct Clazz { void doSomething(const std::shared_ptr<T0>& p0, const std::shared_ptr<T1>& p1) {...
test-img

xishvai

c++

class

c++17

variadic-templates

fold-expression

Votes: 0

Answers: 2

Latest Answer

You can use std::tuple, also for the param_type. In case you want a tuple of shared pointers, that is: #include <tuple> #include <iostream> #include <memory> template <typename.....
test-img

463035818_is_not_a_number

How do I restrict fold expressions with C++ 20 requirements/concepts?

How do you restrict the allowed types in variadic templates and fold expression using C++20 concepts? For example suppose I'd like to restrict the following fold expression to only support integral ty...
test-img

Gonen I

c++

variadic-templates

c++20

c++-concepts

fold-expression

Votes: 0

Answers: 2

Latest Answer

The minimal change to make it work is: requires (std::is_integral<Args>::value && ...) I'd also suggest using the less verbose is_integral_v<...> instead of is_integral<...>...
test-img

HolyBlackCat

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved