[英]return value does not match function return type
I'm getting errors in vs2013 with the dot_product functions. 我在使用dot_product函数的vs2013中遇到错误。
Here is my usage for dot_product
这是我对
dot_product
用法
// This is in a header file.
Bool circles_collide(const Circle* a, const Circle* b)
{
const float radiusSum = a->radius + b->radius;
const Vector2D distance = subtract_vector(&(a->center), &(b->center));
return dot_product(&distance, &distance) <= radiusSum * radiusSum;
}
//This is the the implementation of dot_product in another header file.
float dot_product(const Vector2D* a, const Vector2D* b)
{
return a->x * b->x + a->y * b->y;
}
I'm also getting same errors with other functions that use const parameters. 使用const参数的其他函数也遇到相同的错误。 Anyone know what could cause this problem?
有人知道什么可能导致此问题吗?
Edit:: I took a screenshot of the errors, [link] http://puu.sh/kaoiy/3baebde6af.png 编辑::我拍摄了错误的屏幕截图,[链接] http://puu.sh/kaoiy/3baebde6af.png
dot_product(&distance, &distance) <= radiusSum * radiusSum;
will result in a c++ bool
type. 将导致c ++
bool
类型。
Bool circles_collide(const Circle* a, const Circle* b)
expects to return Bool
. Bool circles_collide(const Circle* a, const Circle* b)
期望返回Bool
。
I don't know what Bool
is, but looks like the compiler can't make implicitly make one from bool
. 我不知道
Bool
是什么,但是看起来编译器无法从bool
隐式地制造一个。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.