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.54k stars 313 forks source link

Does get_view_by_sel only work under C++ 20? #143

Closed yuxiaojian01 closed 3 years ago

yuxiaojian01 commented 3 years ago

I run this code: auto above_150_view = ibm_df.get_view_by_sel<double, decltype(functor), double, long>("IBM_Close", functor);

under C++ 17, and the program stopped. When I run the above code under C++ 20, it worked. Does it mean get_view_by_sel only work under C++20 ?

yuxiaojian01 commented 3 years ago

In addition, I changed C++ standard to C++20, it worked, but when I compiled the project, it has two "runtime_error", in: 1) HeteroPtrView.tcc line 95, getvector() function: ` if (iter == views.end()) throw std::runtime_error("HeteroPtrView::get_vector(): ERROR: " "Cannot find view");`

2) HeteroView.tcc line 72, getvector() function: `if (iter == views.end()) throw std::runtime_error("HeteroView::get_vector(): ERROR: " "Cannot find view");`

I added " #include " to the above two files, it worked. I am not sure whether these two files missed two "includes" or, it just because of my IDE? (I used VS 2019).

hosseinmoein commented 3 years ago

This is probably specific to the compiler and the version you are using. I cannot reproduce this on my side with gcc or clang Try using a different version of your compiler.

What does adding #include mean exactly? What #includes did you add

yuxiaojian01 commented 3 years ago

I added #include <stdexcept> to the two files above. Sorry about missing <stdexcept>. The editor ignored <> when editing.

hosseinmoein commented 3 years ago

Not a bad idea to add it anyway. I will add it in a couple of days