Skip to content

StlAlgorithm: std::accumulate with counter #34

Open

Description

@pfultz2

This can use std::accumulate when using a RandomAccess range:

        for(auto&& x : v)
        {
            if (i != axis)
                y *= x;
            i++;
        }

Activity

  1. pfultz2 commented on Apr 21, 2019

    @pfultz2
    OwnerAuthor

    And also this:

            for (auto&& x : v)
            {
                if (i > axis)
                    y1 *= x;
                if (i != axis)
                    y1 *= x;
                i++;
            }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions