|
-
June 18th, 2010, 02:50 PM
#1
problem returning a typedef type?
Alright so I'm working on a project right now in which I have written the following code for easy transition between data types:
//so that I can change the data type when I want to
typedef float value;
//so that I can change this function when I want to as well
#define val_sqrt sqrtf;
And I plan to use these throughout my project. Unfortunately, I've run into a bit of a problem.
Say I have the following function definition:
value SomeClass::ReturnSqrt(void) const
{
return val_sqrt(a_*a_ + b_*b_);
}
Because the sqrtf function returns a float and not my defined 'value', I keep getting this error:
'return' : cannot convert from 'float (__cdecl *)(float)' to 'value'
What I'd like to ask is am I missing something important? Or how do I fix what I'm doing incorrectly?? Thanks in advance for the help!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|