Skip to content

Fixing iteration-type of for-loop. #165

@amitsingh19975

Description

@amitsingh19975

The current loops rely on auto deduction or integer suffix for the type that may not be a correct iteration type and may produce conversion warnings all over places. Therefore, I propose to remove auto from the loops and use appropriate and explicit types or use explicit types to initialize the variable. In a long run, it would produce a bug-free code, and it would remove all warnings produced by compilers.

From

for(auto d = 0u; d < t.size(); ++d)
{
...
}

To

for(auto d = size_type{0}; d < t.size(); ++d)
{
...
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions