hosseinmoein / DataFrame

C++ DataFrame for statistical, Financial, and ML analysis -- in modern C++ using native types and contiguous memory storage
https://hosseinmoein.github.io/DataFrame/
BSD 3-Clause "New" or "Revised" License
2.45k stars 310 forks source link

binary '-': 'const _Ty' does not define this operator or a conversion to a type acceptable to the predefined operator #194

Closed yegorrr closed 2 years ago

yegorrr commented 2 years ago

when bucketizing (even "by_count"), compiler throws this error referring to the line containing src_idx[i] - src_idx[marker]

under ubuntu with g++ there's no such problem. i guess it's because of time (ctime?) internals? i'm using msvc 2022(v143)

hosseinmoein commented 2 years ago

What is the type of your index, when you declare DataFrame?

yegorrr commented 2 years ago

StdDataFrame<DateTime> - that's hello world example (DTDataFrame)

hosseinmoein commented 2 years ago

That is strange because DateTime has an operator that converts it to a double. it compiles fine for me on Ubuntu, Mac, and Windows , gcc and VC++

yegorrr commented 2 years ago

i also tried 2019 visual studio (v142), it won't compile. it also doesn't like this bit: ` struct DT_initializer { DT_initializer () noexcept {

ifdef _WIN32

        _tzset ();

else

        ::tzset ();

endif // _WIN32

    }
};

inline static const DT_initializer  dt_init_ {  };

friend class    DT_initializer;`

it shows a warning that type DT_initializer has been declared as a struct and now being declared as a class. so maybe it's confusing that operato(which one btw? something like operator =?) with something else?

hosseinmoein commented 2 years ago

You are mixing very old library code with hello world which is new. Those problems were solved sometime ago

yegorrr commented 2 years ago

indeed, that source apparently was from the vcpkg package. that's why it didn't build with DataFrame.lib (as i posted in another thread). so i when i got everything from github it worked fined (and on ubuntu i didn't use vcpkg, i was cloning from here). you may check the vcpkg package and edit the instructions, i'm sure it'll confuse a lot of people

yegorrr commented 2 years ago

You are mixing very old library code with hello world which is new. Those problems were solved sometime ago

everywhere in the docs there's MyDataFrame df;

which i assume is an old version? should be something like ULDataFrame (StdDataFrame<unsigned long>)