Skip to content

Instantly share code, notes, and snippets.

View cjdb's full-sized avatar

Christopher Di Bella cjdb

View GitHub Profile
[
{
"name": "Build LLVM",
"preferredGenerator": {
"name": "Ninja"
},
"cmakeSettings": {
"CMAKE_TOOLCHAIN_FILE": "${workspaceFolder}/toolchain.cmake",
"LLVM_BUILD_TOOLS": "Yes",
"LLVM_ENABLE_LIBCXX": "Yes",
error: call to deleted function call operator in type 'const __begin::__fn'
std::ranges::begin(s);
^~~~~~~~~~~~~~~~~~
note: candidate function [with auto:1 = S &] has been explicitly deleted
void operator()(auto&&) const = delete;
^
candidate template ignored: could not match '_Tp[]' against 'S'
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[]) const noexcept
^
candidate template ignored: could not match '_Tp[_Np]' against 'S'
error: call to deleted function call operator in type 'const __begin::__fn'
std::ranges::begin(s);
^~~~~~~~~~~~~~~~~~
note: candidate function [with auto:1 = S &] has been explicitly deleted
void operator()(auto&&) const = delete;
^
candidate template ignored: could not match '_Tp[]' against 'S'
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[]) const noexcept
^
candidate template ignored: could not match '_Tp[_Np]' against 'S'
error: call to deleted function call operator in type 'const __begin::__fn'
std::ranges::begin(s);
^~~~~~~~~~~~~~~~~~
(1) note: candidate function [with auto:1 = S &] has been explicitly deleted
void operator()(auto&&) const = delete;
^
(2) candidate template ignored: could not match '_Tp[]' against 'S'
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[]) const noexcept
^
(2) candidate template ignored: could not match '_Tp[_Np]' against 'S'
# Copyright (c) Christopher Di Bella.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
Language: Cpp
Standard: Latest
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Right
AlignConsecutiveAssignments: None
cjdb@cjdb2: ~ ✓
$ time clang++ -std=c++2b -Oz -DNDEBUG noadl.cpp
real 0m0.118s
user 0m0.068s
sys 0m0.053s
cjdb@cjdb2: ~ ✓
$ time clang++ -std=c++2b -Oz -DNDEBUG noadl.cpp
real 0m0.119s
# Copyright (c) Christopher Di Bella.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
Language: Cpp
Standard: Latest
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Right
AlignConsecutiveAssignments: None
@cjdb
cjdb / benchmark-clang.py
Created October 5, 2022 20:36
A script for crudely benchmarking a program
#!/usr/bin/env python3
# Copyright (c) Google LLC.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
import timeit
import subprocess
import statistics
// Copyright 2022 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@cjdb
cjdb / to.cpp
Created February 29, 2020 19:34
ranges::to
// Copyright (c) Google LLC.
// SPDX-License-Identifier: Apache-2.0
//
#include <algorithm>
#include <concepts>
#include <iterator>
#include <ranges>
// NOTE: Testing still required.