Click here to Skip to main content
16,022,752 members

Comments by amirea (Top 8 by date)

amirea 1-Mar-21 8:56am View    
Thank you for sticking around and helping me! It turned out that my code was valid but it took me 1.5 days to figure out that the errors are a bug of the IDE's. After building with the errors still there, the errors were gone.
It didn't occur to me but I found this:

https://stackoverflow.com/questions/3015624/how-to-declare-type-conversion-in-header-file-and-implement-in-cpp-file

and please see the op comment saying it worked with clean project:

https://stackoverflow.com/questions/3015624/how-to-declare-type-conversion-in-header-file-and-implement-in-cpp-file#comment3082516_3015624

and I admit I had my reserves, I tried clean -- didn't work, then built and that solved it. Still, that's a shame... What would happen if the project would need 5 minutes of build time? Imagine building at every error :)

Back to your code: it is clearer than what I wrote and I'll go with that. Thanks again.
amirea 26-Feb-21 3:54am View    
Thanks. There's a problem though, all information and examples on custom conversion function I found on Google, including that at the link you provided don't involve namespaces. And they don't present it split into header and implementation files.
_This_ apparently makes the difference in my case.
amirea 25-Feb-21 13:53pm View    
I know the types, I chose to use integer instead of floating point for precision and consistency reasons. And thank you for pointing that out, there's never too much or too obvious information.
amirea 25-Feb-21 13:49pm View    
Thank you for taking a look at the code. I don't want to just get things done. I want to learn the proper way to do it. Learn once, use it forever :)
amirea 25-Feb-21 13:45pm View    
I must got them confused. I thought they were the same thing.