Home:ALL Converter>Is it possible to infer second template argument type for this template class?

Is it possible to infer second template argument type for this template class?

Ask Time:2022-08-27T17:50:27         Author:JosephK

Json Formatter

I have a template class A

template<template<class> class E, class N>
class A
{}

and I also have a template function that takes A as an argument:

template<class T>
auto make_something(const T& t){}

used like make_something(a) on an object a of A type.

I would like to be able to tell what is the type N from inside the make_something function. Is there any way of achieving this without changing the template argument of make_something?

Author:JosephK,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/73509946/is-it-possible-to-infer-second-template-argument-type-for-this-template-class
yy