From 3ac57795fe8e28915523de6dd95e336a3eaa8064 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 7 Jun 2008 06:15:07 +0000 Subject: This seems to have done the trick, on the 32 bit platform, anyway. Turns out it's a bad idea to rely on the intNN_t typedefs. I enumerated all non-pointer primitives in c++ (except void, you can't store things in a void), and it works great. I also discovered C and C++ actually have unsigned char, signed char, and char, which are all distinct types. It supports all three now. In addition, I got rid of all of the specific && operators, the general one covers it all. Also, the unit tests all pass for now. Now to try it on the 64bit system. --- src/archive.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/archive.h') diff --git a/src/archive.h b/src/archive.h index 31683bb..95c8c0c 100644 --- a/src/archive.h +++ b/src/archive.h @@ -88,6 +88,33 @@ namespace Bu virtual void write(const void *, int32_t); virtual void read(void *, int32_t); + virtual Archive &operator<<(bool p); + virtual Archive &operator<<(char p); + virtual Archive &operator<<(signed char p); + virtual Archive &operator<<(unsigned char p); + virtual Archive &operator<<(signed short p); + virtual Archive &operator<<(unsigned short p); + virtual Archive &operator<<(signed int p); + virtual Archive &operator<<(unsigned int p); + virtual Archive &operator<<(signed long p); + virtual Archive &operator<<(unsigned long p); + virtual Archive &operator<<(signed long long p); + virtual Archive &operator<<(unsigned long long p); + + virtual Archive &operator>>(bool &p); + virtual Archive &operator>>(char &p); + virtual Archive &operator>>(signed char &p); + virtual Archive &operator>>(unsigned char &p); + virtual Archive &operator>>(signed short &p); + virtual Archive &operator>>(unsigned short &p); + virtual Archive &operator>>(signed int &p); + virtual Archive &operator>>(unsigned int &p); + virtual Archive &operator>>(signed long &p); + virtual Archive &operator>>(unsigned long &p); + virtual Archive &operator>>(signed long long &p); + virtual Archive &operator>>(unsigned long long &p); + + /* virtual Archive &operator<<(bool); virtual Archive &operator<<(int8_t); virtual Archive &operator<<(int16_t); @@ -128,6 +155,7 @@ namespace Bu virtual Archive &operator&&(float &); virtual Archive &operator&&(double &); virtual Archive &operator&&(long double &); + */ /** * For storage, get an ID for the pointer to the object you're going to -- cgit v1.2.3