I get following warnings for coded class. Any suggestions or hints ?
heap.h: In copy constructor ‘Edge::Edge(const volatile Edge&)’:
heap.h:12: warning: object of type ‘const volatile Edge&’ will not be accessed in void context
heap.h: In member function ‘volatile Edge& Edge::operator=(volatile Edge&) volatile’:
heap.h:28: warning: object of type ‘volatile Edge&’ will not be accessed in void context
heap.h: In member function ‘bool Edge::operator<(volatile Edge&) volatile’:
heap.h:38: warning: object of type ‘volatile Edge&’ will not be accessed in void context
struct Edge {
int vertexID;
float edgeWeight;
__device__ Edge() : vertexID(-1), edgeWeight(0.0) {}
__device__ Edge(int id, float weight) {
vertexID = id;
edgeWeight = weight;
}
__device__ Edge (volatile const Edge& copy_from_me){
this->vertexID=copy_from_me.vertexID;
this->edgeWeight=copy_from_me.edgeWeight;
}
__device__ Edge (const Edge& copy_from_me){
this->vertexID=copy_from_me.vertexID;
this->edgeWeight=copy_from_me.edgeWeight;
}
__device__ Edge& operator=(const Edge& other) {
this->edgeWeight=other.edgeWeight;
this->vertexID=other.vertexID;
return *this;
}
__device__ volatile Edge& operator=(volatile Edge& other) volatile{
this->edgeWeight=other.edgeWeight;
this->vertexID=other.vertexID;
return *this;
}
__device__ bool operator>(const Edge &other)const {
return (edgeWeight > other.edgeWeight) || ((edgeWeight == other.edgeWeight) && (vertexID > other.vertexID));
}
__device__ bool operator<(volatile Edge &other)volatile {
return (edgeWeight < other.edgeWeight) || ((edgeWeight == other.edgeWeight) && (vertexID < other.vertexID));
}
};