Skip to content

A header only utility function for getting the size of a container as a signed type

Notifications You must be signed in to change notification settings

pierrechevalier83/signed_size

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

signed_size

A header only utility function for getting the size of a container as a signed type.

Motivation

In a nutshell: It allows to use old-style for loops without triggering sign comparison warnings:

    for (int i = 0; i < signed_size(container); ++i) { ... }
    for (int64_t i = 0; i < signed_size(big_container); ++i) { ... }

Check out this article for a detailed explanation about the motivation.

Build

  • mkdir build
  • cd build
  • cmake ..
  • make
  • make test

About

A header only utility function for getting the size of a container as a signed type

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published