Új hozzászólás Aktív témák
-
DrojDtroll
veterán
válasz
DrojDtroll
#4360
üzenetére
Meglett a megoldás.
c++ - variadic function template without formal parameters - Stack Overflow
Another way is turning the non-template function
finto a variadic template function which accepts zero or more template arguments (the otherfrequires one or more template arguments). Then to avoid ambiguity, SFINAE away this template function when the number of arguments is not zero. Well, a code is better than 1000 words:#include <type_traits>template <typename... Ts>typename std::enable_if<sizeof...(Ts) == 0>::type f() { }template <typename T, typename... Ts>void f(){// do something withTf<Ts...>();}
Új hozzászólás Aktív témák
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- Samsung Galaxy A35 5G 256GB, Kártyafüggetlen, 1 Év Garanciával
- LG 27GR95QE - 27" OLED / QHD 2K / 240Hz & 0.03ms / NVIDIA G-Sync / FreeSync Premium / HDMI 2.1
- BESZÁMÍTÁS! Asus H370 i5 9600K 16GB DDR4 512B SSD RTX 2060 Super 8GB Chieftec HC-10B-OP Zalman 850W
- HIBÁTLAN iPhone 13 mini 128GB Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS3846, 100% Akkumulátor
- GYÖNYÖRŰ iPhone 15 128GB Black -1 ÉV GARANCIA - Kártyafüggetlen, MS3944, 100% Akkumulátor
Állásajánlatok
Cég: ATW Internet Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest

