overload-resolution
Calling a const function rather than its non-const version
I tried to wrap something similar to Qt\'s shared data pointers for my purposes, and upon testing I found out that when the const function should be called, its non-const version was chosen instead.[详细]
2023-04-01 21:08 分类:问答Method overload resolution using dynamic argument
This may have been answered before. I see many \"dynamic method overload resolution\" questions, but none that deal specifically with passing a dynamic argument. In the following code, in Test, the la[详细]
2023-03-30 21:40 分类:问答Ambiguous call of overloaded constructor due to super class (pass by value)
I wrote a little C++ wrapper around some parts of GSL and encounter the following puzzle (for me). The code (reduced to its essentials) is as follows:[详细]
2023-03-29 19:59 分类:问答C++ compiler picking the wrong overload of a class member function
I have this code: template <class T> class Something { T val; public: inline Something() : val() {} inline Something(T v) : val(v) {}[详细]
2023-03-29 00:53 分类:问答c++ overload operator resolution
I\'m learning c++ and using C++ Primer. Consider the following exercise 14.46: class Complex { Complex(double);[详细]
2023-03-21 16:50 分类:问答StackOverflowException in overloaded methods
I\'m trying to call overloaded method in code like this: public abstract class BaseClass<T> { public abstract bool Method(T other);[详细]
2023-03-17 04:50 分类:问答What is the cause of this overload resolution headache?
I\'ve got a program where I\'ve got a lot of nested if/switch statements which were repeated in several places. I tried to extract that out and put the switches in a template method class, and then al[详细]
2023-03-16 19:49 分类:问答C++0x const RValue reference as function parameter
I am trying to understand why someone would write a function that takes a const rvalue reference. In the code example below what purpose is the const rvalue reference function (returning \"3\").[详细]
2023-03-12 05:07 分类:问答Trouble with const/non-const overload resolution
I have a class that looks something like this: class ClassA { public: 开发者_如何学编程float Get(int num) const;[详细]
2023-03-11 14:11 分类:问答Why does this constructor overload resolve incorrectly?
This is my (stripped) class and instantiation of one object: template <typename T, typename Allocator = std::allocator<T> >[详细]
2023-03-06 17:07 分类:问答