Jikka-5.0.11.1: A transpiler from Python to C++ for competitive programming
Copyright(c) Kimiyuki Onaka 2020
LicenseApache License 2.0
Maintainerkimiyuki95@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Jikka.CPlusPlus.Convert.OptimizeRange

Description

 
Synopsis

Documentation

run :: MonadError Error m => Program -> m Program Source #

run replaces superfluous copying.

Examples

Before:

int b = range(a).size();

After:

int b = a;

Before:

for (int i : jikka::range(n)) {
    ...
}

After:

for (int i = 0; i < n; ++ i) {
    ...
}