I do this syntax for myself as I think it is more convenience for later.
temolate<typename U> struct identity{typedef U type;};
temolate<typename T, typename identity<T>::type value=0> struct my{
typedef std::vector<T> vec;
typedef std::array<T,value> arr;
typedef std::set<T> set;
// and so forth
};
And I use it:
int main(){
my<int>::vec v; // okay
my<int,3>::arr a; // okay
// and so forth
}
But I also wish to do this syntax:
(specialize of my above)
template<??????????> // what should I do here?
struct my<?????????>{ // or may be here
typedef int i;
typedef float f;
typedef double d;
// and so forth;
}
So that I can do this:
int main(){
my::i a; // for int, what should I do?
my::f b; // for float, and
my::d c; // for double, and
// AND I ALSI CAN
my<int>::vec v; // already I know
my<int,3>::arr a; // and know
}
Is it possible?
I have seen here:
Default template parameter partial specialization
before I ask. So I know my<>::i
is possible.
And I also know how to use alias with using
I JUST ASK it is possible? Instead of saying NO to me, you get me downvote