ben-strasser / fast-cpp-csv-parser

fast-cpp-csv-parser
BSD 3-Clause "New" or "Revised" License
2.12k stars 439 forks source link

Compile errors under Embarcadero C++ compiler #33

Closed mmaraya closed 7 years ago

mmaraya commented 7 years ago

Thanks for this library and it works great under macOS/LLVM. I do have a need to run this library under Win32 and for reasons I won't go into here, I'm using a free C++11 compiler from Embarcadero (Borland C++ in my youth). bcc32c reports the following errors:

include\fast-cpp-csv-parser/csv.h:236:52: error: use of overloaded operator '!=' is ambiguous
(with operand types 'const std::unique_ptr<ByteSourceBase>' and 'int')
                                return byte_source != 0;
include\fast-cpp-csv-parser/csv.h:262:48: error: use of overloaded operator '!=' is ambiguous
(with operand types 'std::unique_ptr<ByteSourceBase>' and 'int')
                                if(byte_source != 0){
include\fast-cpp-csv-parser/csv.h:296:52: error: use of overloaded operator '!=' is ambiguous 
(with operand types 'const std::unique_ptr<ByteSourceBase>' and 'int')
                                return byte_source != 0;

Any thoughts or insights?

ben-strasser commented 7 years ago

Hi,

can you test whether replacing 0 with nullptr helps? Otherwise, just removing the != 0 should work as a unique_ptr is implicitly convertible to a boolean. Please, report whether yo get it to work and what you did.

Best Regards Ben Strasser

On 12/29/2016 10:03 PM, Mike Maraya wrote:

Thanks for this library and it works great under macOS/LLVM. I do have a need to run this library under Win32 and for reasons I won't go into here, I'm using a free C++11 compiler from Embarcadero https://www.embarcadero.com/free-tools/ccompiler (Borland C++ in my youth). bcc32c reports the following errors:

|include\fast-cpp-csv-parser/csv.h:236:52: error: use of overloaded operator '!=' is ambiguous (with operand types 'const std::unique_ptr' and 'int') return byte_source != 0; | |include\fast-cpp-csv-parser/csv.h:262:48: error: use of overloaded operator '!=' is ambiguous (with operand types 'std::unique_ptr' and 'int') if(byte_source != 0){ | |include\fast-cpp-csv-parser/csv.h:296:52: error: use of overloaded operator '!=' is ambiguous (with operand types 'const std::unique_ptr' and 'int') return byte_source != 0; |

Any thoughts or insights?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ben-strasser/fast-cpp-csv-parser/issues/33, or mute the thread https://github.com/notifications/unsubscribe-auth/ALaAj1iUcXKJzqBvaSMzMbseStMh50m-ks5rNCA9gaJpZM4LX2CB.