Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • D
import std.range.primitives;
n = walkLength(x);

walkLength is a generic solution that works for built-in arrays and containers that implement an input range interface.
auto n = x.length;
with Ada.Containers.Vectors;
use Ada.Containers;
N : Count_Type := X.Length;

New implementation...
< >
programming-idioms.org