Skip to content

static_cast<time_type> in integrate_times #73

@mjziebarth

Description

@mjziebarth

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions