Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.
This repository was archived by the owner on Jan 6, 2026. It is now read-only.

C++1y binary literals and digit separator #23

Description

@msimonsson

Clang 3.4 supports both:
http://clang.llvm.org/cxx_status.html#cxx14

#include <iostream>

int main()
{
    int n = 1'000'000;
    std::cout << n << std::endl;

    unsigned char c = 0b0100'0000;
    std::cout << c << std::endl;

    return 0;
}

I'm new to Vim syntax files, but the following seems to work for binary literals:

syn match   cNumber     display contained "0b[01]\+\(\'[01]\+\)*"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions