C++: Non generic method in generic class?
I am interested in defining a custom method for a generic class for only a
particular data type. I am not sure whats a good way to implement it. I
won't be able to access class variables if I place it outside the class so
I think i can never get it to work that way. If i place it inside the
class, its meant to work for any type T and not just the particular type.
I have been able to get my code to work the latter way by just defining a
generic version of it and sending only that type as input which i m
interested in but is there a neater way to accomplish this?
No comments:
Post a Comment