Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Dart

Idiom #68 Create a bitset

Create an object x to store n bits (n being potentially large).

import 'package:bit_array/bit_array.dart';
final x = FixedBitArray(n);
#include <vector>
std::vector<bool> x(n, 0);

This will create a vector of n bits initialized to 0.

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