Chamada ambígua com função de referência de valor r sobrecarregada
Eu tenho uma classe com as seguintes declarações:
class IcoSphere
{
[...]
private:
int _addVertex(const glm::vec3 &p);
int addVertex(glm::vec3 p);
int addVertex(const glm::vec3 &&p);
[...]
};
Então, eu estou chamando 'addVertex' assim:
IcoSphere sphere;
double t = (1.0 +sqrt(5.0)) /2.0;
sphere.addVertex(glm::vec3(-1,t,0));
O argumento para 'addVertex' obviamente não é uma referência e, no entanto, o compilador g ++ - lança o seguinte erro:
./network/icosphere.cpp: In static member function ‘static void IcoSphere::Create(glm::vec3&, float, std::vector<glm::tvec3<float, (glm::precision)0u> >&, int)’:
./network/icosphere.cpp:46:36: error: call of overloaded ‘addVertex(glm::vec3)’ is ambiguous
sphere.addVertex(glm::vec3(-1,t,0));
^
./network/icosphere.cpp:46:36: note: candidates are:
./network/icosphere.cpp:19:5: note: int IcoSphere::addVertex(glm::vec3)
int IcoSphere::addVertex(glm::vec3 p) {_addVertex(p);}
^
./network/icosphere.cpp:20:5: note: int IcoSphere::addVertex(const vec3&&)
int IcoSphere::addVertex(const glm::vec3 &&p) {_addVertex(p);}
^
Isso não faz muito sentido para mim, por que está considerando uma ligação ambígua?