Function/Method Overloading C++: Data type confusion?

前端 未结 7 2503
清酒与你
清酒与你 2021-02-14 18:11

I\'m having some trouble overloading methods in C++. As an example of the problem, I have a class with a number of methods being overloaded, and each method having one parameter

7条回答
  •  南笙
    南笙 (楼主)
    2021-02-14 18:53

    Not answering your question but, just out of curiosity, is there a hidden reason for not using a template method instead of defining an overload version for each type?

    class SomeClass
    {
        public:
        ...
        template 
        void Method(T paramater);
    };
    

提交回复
热议问题