template class with different members

Can I join the following 2 (simplified) classes with templates?

1
2
3
4
5
6
7
8
9
struct A
{
constexpr size_t offset = 0;
}

struct B
{
size_t offset;
}
closed account (zb0S216C)
What do you mean by "join"?

Wazzak
something like this: (not working of-course)

1
2
3
4
5
6
7
8
template<class T>
struct Vector
{
   T offset;
};

typedef Vector<constexpr size_t = 0> ShiftedVector;
typedef Vector<size_t> NonShiftedVector;



As you can imagine, constexpr size_t offset produce very fast code.
closed account (zb0S216C)
I don't understand what you're trying to do. What's the difference between the two?

Wazzak
Topic archived. No new replies allowed.