-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Hi, I tested with enum with default value 0, the buffer stored is empty. v0.9.9
Repro
#include "SimpleBinStream/SimpleBinStream.h"
#include <iostream>
#include <sstream>
using namespace std;
enum TestEnum : unsigned char
{
EnumOne
, EnumTwo
, EnumThree
// If I use this, then the buffer shows out properly
// EnumOne = 1
// , EnumTwo = 2
// , EnumThree = 3
, End
};
int main (int argc, char * argv [])
{
simple::mem_ostream <std::true_type> out;
// this is problem
out << TestEnum::EnumOne;
// this is fine
//out << TestEnum::EnumOne;
const char * buffer = reinterpret_cast <const char*> (out.get_internal_vec ().data ());
int buffersize = out.get_internal_vec ().size ();
// Output buffer here is nothing unless I assign values to the enum
cout << "out\nBufferSize:" << buffersize << " buffer:" << buffer << "*" << endl;
return 0;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels