Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static_cast<time_type> in integrate_times #73

Open
mjziebarth opened this issue Apr 6, 2024 · 0 comments
Open

static_cast<time_type> in integrate_times #73

mjziebarth opened this issue Apr 6, 2024 · 0 comments

Comments

@mjziebarth
Copy link

Hi,

it seems to me that there are a number of static_cast<time_type> in the integrate_times implementation, e.g.

while( less_with_sign( current_time , static_cast<time_type>(*start_time) , current_dt ) )

while( less_with_sign( current_time , static_cast<time_type>(*start_time) , dt ) )

Time last_time_point = static_cast<time_type>(*last_time_iterator);

(and potentially more; L139 is where I encountered a compiler error) that don't fit the the target variables' types. Say, for instance, Time in these cases is a Boost Units quantity, then time_type, if I understand correctly, is a plain double (or other floating point format). If I further understand the TimeIterator type correctly, that type should return a Time instance on valid dereference.

Now the static_cast tries to cast a quantity to, say, double (which fails), which is then reassigned to a quantity (which should
also fail).

It seems to me that simply removing the static casts might fix the issue, although I have not spent much time looking into it.
For now I'll use another integrator but I'd be happy to help to solve this issue in the future - if my hypothesis is correct.

Best
Malte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant