KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to write something like: // I don't know how this particular syntax should look... template<typename template<typename Ty> FunctorT> Something MergeSomething(const Something& lhs, const Something& rhs) { Something result(lhs); if (lhs.IsUnsigned() && rhs.IsUnsigned()) { result.SetUnsigned(FunctorT<unsigned __int64>()(lhs.UnsignedValue(), rhs.UnsignedValue())); } else { result.SetSigned(FunctorT<__int64>()(lhs.SignedValue(), rhs.SignedValue())); } return result; } which would be used like: Something a, b; Something c = MergeSomething<std::plus>(a, b); How do I do that?
Tags (comma-separated)
Save Edits
Cancel