doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
ab878419-5eb4-4f84-a7bf-eebf1dc6da3c
{ "language": "C++" }
```c++ // Copyright 2014-present Bill Fisher. All rights reserved. #include "ofp/yaml/yllvm.h" #include "ofp/yaml/ycontrollermaxlen.h" using namespace ofp; using ofp::yaml::EnumConverterSparse; #define OFP_NAME(s) \ { OFPCML_##s, #s } OFP_BEGIN_IGNORE_GLOBAL_CONSTRUCTOR static std::pair<OFPControllerMaxLen, llvm...
```c++ // Copyright 2014-present Bill Fisher. All rights reserved. #include "ofp/yaml/yllvm.h" #include "ofp/yaml/ycontrollermaxlen.h" using namespace ofp; using ofp::yaml::EnumConverterSparse; #define OFP_NAME(s) \ { OFPCML_##s, #s } OFP_BEGIN_IGNORE_GLOBAL_CONSTRUCTOR static std::pair<OFPControllerMaxLen, llvm...
ecab18e1-c9e1-43b9-b709-c433cf1015a8
{ "language": "C++" }
```c++ //=-- lsan_linux.cc -------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //=-- lsan_linux.cc -------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
a403b75b-3448-48ec-bc9d-0d7888fb27c5
{ "language": "C++" }
```c++ #include <puppet/compiler/evaluation/functions/alert.hpp> #include <puppet/compiler/evaluation/functions/call_context.hpp> #include <puppet/compiler/evaluation/scope.hpp> #include <puppet/logging/logger.hpp> using namespace std; using namespace puppet::runtime; namespace puppet { namespace compiler { namespace...
```c++ #include <puppet/compiler/evaluation/functions/alert.hpp> #include <puppet/compiler/evaluation/functions/call_context.hpp> #include <puppet/compiler/evaluation/scope.hpp> #include <puppet/logging/logger.hpp> using namespace std; using namespace puppet::runtime; namespace puppet { namespace compiler { namespace...
a595301d-39bf-4092-9690-3f6419f542e1
{ "language": "C++" }
```c++ // Test header and library paths when Clang is used with Android standalone // toolchain. // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: -target arm-linux-androideabi \ // RUN: -B%S/Inputs/basic_android_tree \ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ // RUN: ...
```c++ // Test header and library paths when Clang is used with Android standalone // toolchain. // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: -target arm-linux-androideabi \ // RUN: -B%S/Inputs/basic_android_tree \ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ // RUN: ...
c8f60d2e-fc33-4f18-ba92-155b33fb0436
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/basictypes.h" #include "base/file_path.h" #include "build/build_config.h" #include "chrome/test/automation/tab_proxy.h" #include...
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/basictypes.h" #include "base/file_path.h" #include "build/build_config.h" #include "chrome/test/automation/tab_proxy.h" #include...
66a05b40-dded-49cc-a186-6ab2bab8561d
{ "language": "C++" }
```c++ // RUN: %clang -g -S -fverbose-asm %s -o - | FileCheck %s // CHECK: TAG_namespace namespace A { enum numbers { ZERO, ONE }; } using namespace A; numbers n; ``` Make front-end debug info namespace test frontend-only & more specific without overconstraining it
```c++ // RUN: %clang -g -S -emit-llvm %s -o - | FileCheck %s namespace A { int i; } // CHECK: [[FILE:![0-9]*]] = {{.*}} ; [ DW_TAG_file_type ] [{{.*}}/test/CodeGenCXX/debug-info-namespace.cpp] // CHECK: [[VAR:![0-9]*]] = {{.*}}, metadata [[NS:![0-9]*]], metadata !"i", {{.*}} ; [ DW_TAG_variable ] [i] // CHECK: [[NS...
ef22c4fc-7ff3-4786-b969-2f55ad756233
{ "language": "C++" }
```c++ //===-- PluginLoader.cpp - Implement -load command line option ------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===-- PluginLoader.cpp - Implement -load command line option ------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
0a59dcf5-aafe-4b4c-a15e-cb7b022883d9
{ "language": "C++" }
```c++ #include "BracketedSentenceWidget.hh" #include <QDebug> #include <QPainter> #include <QTextEdit> #include <QSettings> BracketedSentenceWidget::BracketedSentenceWidget(QWidget *parent) : QTextEdit(parent), d_stylesheet(":/stylesheets/bracketed-sentence.xsl"), d_transformer(d_stylesheet) { QFontM...
```c++ #include "BracketedSentenceWidget.hh" #include <QDebug> #include <QPainter> #include <QTextEdit> #include <QSettings> BracketedSentenceWidget::BracketedSentenceWidget(QWidget *parent) : QTextEdit(parent), d_stylesheet(":/stylesheets/bracketed-sentence.xsl"), d_transformer(d_stylesheet) { QFontM...
7066df72-e7e8-4ab2-8ee2-4118612b06cc
{ "language": "C++" }
```c++ #include <boost/mpi.hpp> #include <iostream> #include <string> #include <set> #include <boost/serialization/string.hpp> #include "InstrumentFactories.h" #include "Stochastic.h" #include "Ising.h" #include "Measurement.h" namespace mpi = boost::mpi; int main(int argc, char* argv[]) { mpi::environment env(a...
```c++ #include <boost/mpi.hpp> #include <iostream> #include <string> #include <set> #include <boost/serialization/string.hpp> #include "InstrumentFactories.h" #include "Stochastic.h" #include "Ising.h" #include "Measurement.h" namespace mpi = boost::mpi; int main(int argc, char* argv[]) { mpi::environment env(a...
0d9d4ccb-a9c6-450b-9c35-ea5fec40ef1f
{ "language": "C++" }
```c++ #include "tree.hh" #include "tree-entry.hh" namespace mimosa { namespace git { Tree::Tree(git_repository * repo, const git_oid * id) : tree_(nullptr) { if (id) git_tree_lookup(&tree_, repo, id); } Tree::Tree(git_repository * repo, const ...
```c++ #include "tree.hh" #include "tree-entry.hh" namespace mimosa { namespace git { Tree::Tree(git_repository * repo, const git_oid * id) : tree_(nullptr) { if (id) git_tree_lookup(&tree_, repo, id); } Tree::Tree(git_repository * repo, const ...
235a4d6a-8451-4a96-b350-78a476544663
{ "language": "C++" }
```c++ #include "stdafx.h" #include <dukat/timermanager.h> namespace dukat { Timer* TimerManager::create_timer(float interval, std::function<void(void)> callback, bool recurring) { auto timer = std::make_unique<Timer>(++last_id, interval, callback, recurring); auto res = timer.get(); ti...
```c++ #include "stdafx.h" #include <dukat/timermanager.h> namespace dukat { Timer* TimerManager::create_timer(float interval, std::function<void(void)> callback, bool recurring) { auto timer = std::make_unique<Timer>(++last_id, interval, callback, recurring); auto res = timer.get(); ti...
3493cafe-9803-4bf8-b96e-6fe7d39ac696
{ "language": "C++" }
```c++ /* * Chemharp, an efficient IO library for chemistry file formats * Copyright (C) 2015 Guillaume Fraux * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/ */ ...
```c++ /* * Chemharp, an efficient IO library for chemistry file formats * Copyright (C) 2015 Guillaume Fraux * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/ */ ...
1c3128d6-fb99-47d7-94d9-441b0f9af448
{ "language": "C++" }
```c++ /***************************************************************************** * * X testing environment - Google Test environment feat. dummy x server * * Copyright (C) 2011 Canonical Ltd. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Pub...
```c++ #include <xorg/gtest/test.h> using namespace xorg::testing; /** * @example xorg-gtest.cpp * * This is an example for using the fixture * xorg::testing::Test for your own tests. Please * make sure that you have the X.org dummy display * driver installed on your system and that you execute * the test with...
aaac36d9-455e-4aa2-860e-e7854e42eff1
{ "language": "C++" }
```c++ // Copyright 2015 Matt Heard // http://mattheard.net // matt@mattheard.net // @mattheard #include <opencv2/opencv.hpp> #include <iostream> #include <string> int main(int argc, char **argv) { using std::string; const int expectedNumArgs = 3; if (argc != expectedNumArgs) { const string cmdNam...
```c++ // Copyright 2015 Matt Heard // http://mattheard.net // matt@mattheard.net // @mattheard #include <opencv2/opencv.hpp> #include <iostream> #include <string> using cv::Mat; Mat buildLookUpTable(const int divideWith) { return Mat(); } int main(int argc, char **argv) { using std::string; const int e...
4126d44b-721c-4de2-9455-bcf1d7867b2b
{ "language": "C++" }
```c++ /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 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 http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable l...
```c++ /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 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 http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable l...
e9975786-bc4a-4052-b831-08e4a7409993
{ "language": "C++" }
```c++ #include <bits/stdc++.h> using namespace std; struct Fenwick { vector<int> data; int len; Fenwick(int l) { len = l; data.assign(l + 1, 0); } void update(int at, int by) { while (at < len) { data[at] += by; at |= (at + 1); } } int query(int at) { int res = 0; while (at >= 0) { res...
```c++ #include <bits/stdc++.h> using namespace std; class Fenwick { private: vector<int> data; vector<int> dataMul; int len; bool range; void internalUpdate(int at, int mul, int add) { while (at < len) { dataMul[at] += mul; data[at] += add; at |= (at + 1); } } int queryStd(int at) { int res ...
45ba1706-6c6b-4398-b4be-350298d214bd
{ "language": "C++" }
```c++ /* Main Process for CLI tlisp */ /* Compile using g++ -std=c++11 -Wall main.cpp -o tlisp */ #include <iostream> #include <string> #include <iomanip> /* OSX / Linux Libraries */ // #include <readline.h> // #include <editline/history.h> using std::cin; using std::cout; using std::endl; using std::setw; using st...
```c++ /* Main Process for CLI tlisp */ /* Compile using g++ -std=c++11 -Wall main.cpp -o tlisp */ #include <iostream> #include <iomanip> #include <string.h> /* OSX / Linux Libraries */ // #include <readline.h> // #include <editline/history.h> using std::cin; using std::cout; using std::endl; using std::setw; void ...
63db0614-8e75-40e8-ac59-ec9ba459716d
{ "language": "C++" }
```c++ // // Copyright (c) 2018 The nanoFramework project contributors // Portions Copyright (c) Microsoft Corporation. All rights reserved. // See LICENSE file in the project root for full license information. // #include <ssl.h> #include "mbedtls.h" int ssl_write_internal( int sd, const char* data, size_t req_le...
```c++ // // Copyright (c) 2018 The nanoFramework project contributors // Portions Copyright (c) Microsoft Corporation. All rights reserved. // See LICENSE file in the project root for full license information. // #include <ssl.h> #include "mbedtls.h" int ssl_write_internal( int sd, const char* data, size_t req_le...
750230da-c2e4-48cd-a008-c525f20e19da
{ "language": "C++" }
```c++ #include "ofMain.h" #include "ofApp.h" #include <stdlib.h> int main(int argc, char* argv[]){ if (argc < 2) { exit(1); return 0; } else { ofSetupOpenGL(1024,768,OF_FULLSCREEN); ofRunApp(new ofApp(argv[1])); } } ``` Add error message for missing socket.
```c++ #include "ofMain.h" #include "ofApp.h" #include <iostream> #include <stdlib.h> int main(int argc, char* argv[]){ if (argc < 2) { cerr << "Usage: interface <socket path>"; exit(1); return 0; } else { ofSetupOpenGL(1024,768,OF_FULLSCREEN); ofRunApp(new ofApp(argv[1]...
2f0c85a1-2bfa-4b7a-b6b3-72711e33a27a
{ "language": "C++" }
```c++ // // StaticAnalyser.cpp // Clock Signal // // Created by Thomas Harte on 14/04/2018. // Copyright 2018 Thomas Harte. All rights reserved. // #include "StaticAnalyser.hpp" #include "Target.hpp" Analyser::Static::TargetList Analyser::Static::AppleII::GetTargets(const Media &media, const std::string &, Targe...
```c++ // // StaticAnalyser.cpp // Clock Signal // // Created by Thomas Harte on 14/04/2018. // Copyright 2018 Thomas Harte. All rights reserved. // #include "StaticAnalyser.hpp" #include "Target.hpp" Analyser::Static::TargetList Analyser::Static::AppleII::GetTargets(const Media &media, const std::string &, Targe...
db461404-0731-48a4-921c-40fdf7adfdc4
{ "language": "C++" }
```c++ #include "precompiled.hpp" #include "ui/docks/OpenGLStateWidget.hpp" #include "gl/OpenGLPointers.hpp" namespace balls { OpenGLStateWidget::OpenGLStateWidget(OpenGLPointers& gl, QWidget* parent) : QWidget(parent), m_blendState(gl), m_clipOptions(gl), m_colorOptions(gl), m_depthOptions(gl), ...
```c++ #include "precompiled.hpp" #include "ui/docks/OpenGLStateWidget.hpp" #include "gl/OpenGLPointers.hpp" namespace balls { OpenGLStateWidget::OpenGLStateWidget(OpenGLPointers& gl, QWidget* parent) : QWidget(parent), m_blendState(gl), m_clipOptions(gl), m_colorOptions(gl), m_depthOptions(gl), ...
689ad22c-9be1-4246-8ad6-178761a5ddce
{ "language": "C++" }
```c++ /* Copyright (C) 2008 Paul Richards. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. T...
```c++ /* Copyright (C) 2008 Paul Richards. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. T...
c0d91c21-62d4-4f02-a9c3-945ab6c0dad0
{ "language": "C++" }
```c++ //===- lld/unittest/UniversalDriverTest.cpp -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===- lld/unittest/UniversalDriverTest.cpp -------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
887ca59c-adf3-482e-95cb-b2a7831765e6
{ "language": "C++" }
```c++ // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/extensions/api/guest_view/guest_view_internal_api.h" #include "chrome/browser/guest_view/guest_view_manager.h" #include "...
```c++ // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/extensions/api/guest_view/guest_view_internal_api.h" #include "chrome/browser/guest_view/guest_view_manager.h" #include "...
75cd778e-fe59-4acf-8c66-ec22e84093bb
{ "language": "C++" }
```c++ // Native C++ Libraries #include <iostream> #include <string> #include <sstream> #include <vector> // C++ Interpreter Libraries #include <Console.h> #include <Varible.h> #include <Include.h> using namespace std; int main() { RESTART: string input = ""; getline(cin, input); goto RESTART; } ``` Add some mi...
```c++ // Native C++ Libraries #include <iostream> #include <string> #include <sstream> #include <vector> // C++ Interpreter Libraries #include <Console.h> #include <Varible.h> #include <Include.h> using namespace std; int main() { RESTART: string input = ""; ConsoleOutCheck(input); CheckForInt(input); CheckFor...
92e1c6c4-8a1a-42ed-991c-c1678c69e117
{ "language": "C++" }
```c++ #include "settings.h" int N_POLY_POINTS = 6; int N_COLOR_VAR = 5; int N_POS_VAR = 10; int SHAPE_OPT_FREQ = 0; int GUI_REFRESH_RATE = 1; int AUTOFOCUS_RES = 2; int N_CORES = 4; int FOCUS_LEFT=0, FOCUS_RIGHT=100, FOCUS_TOP=0, FOCUS_BOTTOM=100; int POLYS_MIN=5, POLYS_MAX=150000; // Rates of mutation in % of odd...
```c++ #include "settings.h" int N_POLY_POINTS = 6; int N_COLOR_VAR = 5; int N_POS_VAR = 10; int SHAPE_OPT_FREQ = 0; int GUI_REFRESH_RATE = 1; int AUTOFOCUS_RES = 2; int N_CORES = 4; int FOCUS_LEFT=0, FOCUS_RIGHT=100, FOCUS_TOP=0, FOCUS_BOTTOM=100; int POLYS_MIN=15000, POLYS_MAX=150000; // Rates of mutation in % of...
31b8862e-6abb-44e9-97d0-a5c0d664ffef
{ "language": "C++" }
```c++ #include "settings.h" int N_POLY_POINTS = 6; int N_COLOR_VAR = 5; int N_POS_VAR = 10; int SHAPE_OPT_FREQ = 0; int GUI_REFRESH_RATE = 1; int AUTOFOCUS_RES = 2; int N_CORES = 4; int FOCUS_LEFT=0, FOCUS_RIGHT=100, FOCUS_TOP=0, FOCUS_BOTTOM=100; int POLYS_MIN=5, POLYS_MAX=100; // Rates of mutation in % of odds p...
```c++ #include "settings.h" int N_POLY_POINTS = 6; int N_COLOR_VAR = 5; int N_POS_VAR = 10; int SHAPE_OPT_FREQ = 0; int GUI_REFRESH_RATE = 1; int AUTOFOCUS_RES = 2; int N_CORES = 4; int FOCUS_LEFT=0, FOCUS_RIGHT=100, FOCUS_TOP=0, FOCUS_BOTTOM=100; int POLYS_MIN=5, POLYS_MAX=150000; // Rates of mutation in % of odd...
4ba125fb-eaec-4ed7-afda-1660e62de03b
{ "language": "C++" }
```c++ #include "kronrodLaurieGautschi.h" #include "kronrodPiessensBurkardt.h" #include <iostream> #include <iomanip> using namespace Kronrod; using namespace Eigen; using namespace std; int main() { Array<double,Dynamic,2> ans; int n = 10; ans = multiPrecisionKronrod(n); cout << "Laurie/Gautschi:" ...
```c++ #include "kronrodLaurieGautschi.h" #include "kronrodPiessens.h" #include <iostream> #include <iomanip> using namespace Kronrod; using namespace Eigen; using namespace std; int main() { Array<double,Dynamic,2> ans; int n = 10; ans = multiPrecisionKronrod(n); cout << "Laurie/Gautschi:" << endl;...
d93ba6b8-04e5-44b7-84f4-e3c89138f26f
{ "language": "C++" }
```c++ #include <stdio.h> #include "video.h" int main(int argc, char* argv[]) { if (argc < 3) { printf("missing filename\n"); exit(0); } gst_init (NULL,NULL); int k; sscanf(argv[2], "%d", &k); for (int q = 0; q < k; q++) { video testvideo(argv[1]); while (testvideo.getvisible()) { testvideo.update...
```c++ /* Copyright 2014, Adrien Destugues <pulkomandy@pulkomandy.tk> * Distributed under the terms of the MIT license */ #include <stdio.h> #include <sys/time.h> #include <sys/resource.h> #include "video.h" int main(int argc, char* argv[]) { if (argc < 3) { printf("missing filename\n"); exit(EXIT_FAILURE);...
204d20ef-f245-4181-8bfb-70db40e6ca7c
{ "language": "C++" }
```c++ #include "company.hpp" #include <ref/DescriptorsImpl.ipp> template class ref::ClassDescriptorImpl< example::Company >; ``` Fix compilation error with clang.
```c++ #include "company.hpp" #include <ref/DescriptorsImpl.ipp> template struct ref::ClassDescriptorImpl< example::Company >; ```
6d04589e-e81d-426e-9611-62d956c87513
{ "language": "C++" }
```c++ // RUN: %clangxx_tsan -O1 -DTEST_ERROR=ERANGE %s -o %t && %run %t 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-SYS %s // RUN: %clangxx_tsan -O1 -DTEST_ERROR=-1 %s -o %t && not %run %t 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-USER %s #include <assert.h> #include <errno.h> #include <pthread.h> #include <std...
```c++ // RUN: %clangxx_tsan -O1 -DTEST_ERROR=ERANGE %s -o %t && %run %t 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-SYS %s // RUN: %clangxx_tsan -O1 -DTEST_ERROR=-1 %s -o %t && not %run %t 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-USER %s #include <assert.h> #include <errno.h> #include <pthread.h> #include <std...
05803feb-f720-44ca-ab5a-cb349c5bdb8a
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s enum X : short { A, B }; extern decltype(+A) x; extern int x; enum Y : long { C, D }; extern decltype(+C) y; extern long y; // An enum with a fixed underlying type has an integral promotion to that type, // and to its promoted type. enum B : bool { false_...
```c++ // RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s enum X : short { A, B }; extern decltype(+A) x; extern int x; enum Y : long { C, D }; extern decltype(+C) y; extern long y; // An enum with a fixed underlying type has an integral promotion to that type, // and to its promoted type. enum B : bool { false_...
de009b59-dc6c-4419-bb21-042db112ef72
{ "language": "C++" }
```c++ #include "Game.h" int main(int argc, char** argv) { // A * token followed by another * token in this case is a pointer to a pointer. In this case, argv is a pointer to an array of char*. It is equivalent to (int argc, char* argv[]). Game::Start(); return 0; } ``` Change style of the code and file name
```c++ #include "Game.h" #include <SFML/Graphics.hpp> int main(int argc, char** argv) { // A * token followed by another * token in this case is a pointer to a pointer. In this case, argv is a pointer to an array of char*. It is equivalent to (int argc, char* argv[]). Game::Start(); return 0; } ```
5607e846-b326-495c-be4f-4905e5129399
{ "language": "C++" }
```c++ #include "GLResource.h" #include "renderers/utils/GLResourceManager.h" #include <thread> namespace carto { GLResource::~GLResource() { } bool GLResource::isValid() const { if (_manager.lock()) { return true; } return false; } GLResource::GLResour...
```c++ #include "GLResource.h" #include "renderers/utils/GLResourceManager.h" #include <thread> namespace carto { GLResource::~GLResource() { } bool GLResource::isValid() const { if (auto manager = _manager.lock()) { return manager->getGLThreadId() != std::thread::id(); } ...
916650c1-2a75-4087-804d-31bcd2b9ae0f
{ "language": "C++" }
```c++ #include <paparazzi/SysTime.h> #include <unistd.h> #include <iostream> void printCallBack (uint8_t a) { std::cout << "Call !" << std::endl ; } int main () { SysTime *systime = SysTime::getSysTime () ; tid_t mainID = systime->registerTimer (0.5, printCallBack); tid_t stopID = systime->reg...
```c++ #include "../src/SysTime.h" #include <unistd.h> #include <iostream> void printCallBack (uint8_t a) { std::cout << "Call !" << std::endl ; } int main () { SysTime *systime = SysTime::getSysTime () ; tid_t mainID = systime->registerTimer (0.5, printCallBack); tid_t stopID = systime->regist...
3026cf1f-356e-44ce-a2a4-23676f94874c
{ "language": "C++" }
```c++ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===---------------------------------...
```c++ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===---------------------------------...
75533e83-87d2-4ec9-97b5-86774b36647d
{ "language": "C++" }
```c++ #include <mettle.hpp> using namespace mettle; struct my_type {}; namespace my_namespace { struct another_type {}; } suite<> test_type_name("type_name()", [](auto &_) { _.test("primitives", []() { expect(type_name<int>(), equal_to("int")); expect(type_name<int &>(), equal_to("int &")); expect(t...
```c++ #include <mettle.hpp> using namespace mettle; struct my_type {}; namespace my_namespace { struct another_type {}; } suite<> test_type_name("type_name()", [](auto &_) { _.test("primitives", []() { expect(type_name<int>(), equal_to("int")); expect(type_name<int &>(), regex_match("int\\s*&")); ex...
fad7dea0-379e-4a92-90d2-3d3e7b7551ca
{ "language": "C++" }
```c++ /* * The MIT License (MIT) * * Copyright (c) <2016> <Stephan Gatzka> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the r...
```c++ /* * The MIT License (MIT) * * Copyright (c) <2016> <Stephan Gatzka> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the r...
1f91fb5e-8b0a-45f7-883e-9365e7a6820d
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -std=c++11 %s -verify class X0 { void explicit_capture() { int foo; (void)[foo, foo] () {}; // expected-error {{'foo' can appear only once}} (void)[this, this] () {}; // expected-error {{'this' can appear only once}} (void)[=, foo] () {}; // expected-error {{'&' must preced...
```c++ // RUN: %clang_cc1 -std=c++11 %s -verify class X0 { void explicit_capture() { int foo; (void)[foo, foo] () {}; // expected-error {{'foo' can appear only once}} (void)[this, this] () {}; // expected-error {{'this' can appear only once}} (void)[=, foo] () {}; // expected-error {{'&' must preced...
f1df77b4-13bf-45a0-8e07-5100fc0881c7
{ "language": "C++" }
```c++ #include <need-hug-lib/hpp/NeedHugGame.hpp> #include <need-hug-lib/hpp/ReturnCode/ReturnCodeConverter.hpp> #include <iostream> int main(int argc, char** argv) { using namespace NeedHug; ReturnCode returnCode = ReturnCode::Continue; while(returnCode == NeedHug::ReturnCode::Continue) { // When the code rea...
```c++ #include <need-hug-lib/hpp/NeedHugGame.hpp> #include <need-hug-lib/hpp/ReturnCode/ReturnCodeConverter.hpp> #include <iostream> int main(int argc, char** argv) { using namespace NeedHug; ReturnCode returnCode = ReturnCode::Continue; while (returnCode == NeedHug::ReturnCode::Continue) { // When the code re...
4910a938-48a5-4609-bcee-a321840714f2
{ "language": "C++" }
```c++ #include <iostream> #include <iomanip> // for std::setw #include <nlohmann/json.hpp> using json = nlohmann::json; bool parse_and_dump(const char* text, json& result) { // parse and serialize JSON result = json::parse(text); //std::cout << std::setw(4) << j_complete << "\n\n"; return true; } i...
```c++ #include <iostream> #include <iomanip> // for std::setw #include <nlohmann/json.hpp> bool parse_and_dump(const char* text, nlohmann::json& result) { using json = nlohmann::json; // parse and serialize JSON result = json::parse(text); //std::cout << std::setw(4) << j_complete << "\n\n"; ret...
c40792db-7d86-4845-b27d-661e8fbe66e7
{ "language": "C++" }
```c++ // Copyright 2010 Google Inc. All Rights Reserved. // // 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by app...
```c++ // Copyright 2010 Google Inc. All Rights Reserved. // // 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by app...
4b7cfc65-e33f-4f04-8643-7e69946bb47f
{ "language": "C++" }
```c++ // Copyright (c) 2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/test_file_util.h" #include "base/logging.h" namespace file_util { bool EvictFileFromSystemCache(const FilePath& file) { // ...
```c++ // Copyright (c) 2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/test_file_util.h" #include "base/logging.h" namespace file_util { bool EvictFileFromSystemCache(const FilePath& file) { // ...
138e041e-083c-4b6f-981a-818e2b1351ad
{ "language": "C++" }
```c++ #include "stdafx.h" #include "OpenGLOperatorOculusRiftRenderer.h" namespace operator_view { namespace opengl { OperatorOculusRiftRenderer::OperatorOculusRiftRenderer(std::shared_ptr<IOperatorRenderer> operatorRendererToDecorate) : IOperatorOculusRiftRenderer(operatorRendererToDecorate) { } void Ope...
```c++ #include "stdafx.h" #include "OpenGLOperatorOculusRiftRenderer.h" namespace operator_view { namespace opengl { OperatorOculusRiftRenderer::OperatorOculusRiftRenderer(std::shared_ptr<IOperatorRenderer> operatorRendererToDecorate) : IOperatorOculusRiftRenderer(operatorRendererToDecorate) { } void Ope...
d2613365-a56b-47de-8cca-6ef579463304
{ "language": "C++" }
```c++ // RUN: %clangxx -shared -fPIC -o /dev/null -v -fxray-instrument %s 2>&1 | \ // RUN: FileCheck %s --check-prefix=SHARED // RUN: %clangxx -static -o /dev/null -v -fxray-instrument %s 2>&1 -DMAIN | \ // RUN: FileCheck %s --check-prefix=STATIC // // SHARED-NOT: {{clang_rt\.xray-}} // STATIC: {{clang_rt\.xra...
```c++ // RUN: %clangxx -shared -o /dev/null -v -fxray-instrument %s 2>&1 | \ // RUN: FileCheck %s --check-prefix=SHARED // RUN: %clangxx -static -o /dev/null -v -fxray-instrument %s 2>&1 -DMAIN | \ // RUN: FileCheck %s --check-prefix=STATIC // // SHARED-NOT: {{clang_rt\.xray-}} // STATIC: {{clang_rt\.xray-}} /...
d10a456f-5930-418e-9fa9-3d8c38b82a45
{ "language": "C++" }
```c++ //===- fpcmp.cpp - A fuzzy "cmp" that permits floating point noise --------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===- fpcmp.cpp - A fuzzy "cmp" that permits floating point noise --------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
55fcd766-13ba-4ae4-a929-7c0ca54e2211
{ "language": "C++" }
```c++ #include "Logging.h" #include <SenseKit/sensekit_types.h> INITIALIZE_LOGGING namespace sensekit { void initialize_logging(const char* logFilePath) { const char TRUE_STRING[] = "true"; el::Loggers::addFlag(el::LoggingFlag::CreateLoggerAutomatically); el::Loggers::addFlag(el::L...
```c++ #include "Logging.h" #include <SenseKit/sensekit_types.h> INITIALIZE_LOGGING namespace sensekit { void initialize_logging(const char* logFilePath) { const char TRUE_STRING[] = "true"; el::Loggers::addFlag(el::LoggingFlag::CreateLoggerAutomatically); el::Loggers::addFlag(el::L...
a737300b-8495-49b5-b60c-c980f95d7201
{ "language": "C++" }
```c++ // Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "stdafx.h" #include "search_strstr.h" StrStrSearch::StrStrSearch() : pattern_(NULL), patternLen_(0) { } void Str...
```c++ // Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "stdafx.h" #include "search_strstr.h" #include <algorithm> StrStrSearch::StrStrSearch() : pattern_(NULL), pattern...
4f9b33cc-6c59-4cd0-b720-9098684b197c
{ "language": "C++" }
```c++ //===- tools/lld/lld.cpp - Linker Driver Dispatcher -----------------------===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===---------------------------------------------------------...
```c++ //===- tools/lld/lld.cpp - Linker Driver Dispatcher -----------------------===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===---------------------------------------------------------...
1382c70e-3526-4e0b-a974-711be0dec786
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "views/controls/menu/menu_config.h" #include "grit/app_resources.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/...
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "views/controls/menu/menu_config.h" #include "grit/app_resources.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/...
50fbe76a-60d3-44fb-a375-078855d909a8
{ "language": "C++" }
```c++ #include "herm_padded.h" #ifdef __FULL_HERM #define __(a) a #else #define __(a) #endif // Very simple. Only for even sizes. void herm_padded_inplace(complexd * data, int size, int pitch){ int pad = pitch - size // the same as (size-1)*(pitch+1) , dataend = size * pitch - pad - 1; ; comp...
```c++ #include "herm_padded.h" #ifndef MOVE_TO_TOP // Very simple. Only for even sizes. void herm_padded_inplace(complexd * data, int size, int pitch){ int pad = pitch - size // the same as (size-1)*(pitch+1) , dataend = size * pitch - pad - 1 , jmp = pad + size / 2 ; complexd * pv0...
ed04abf8-11cd-417e-8481-fb39ab7d2c99
{ "language": "C++" }
```c++ #include "LongestValidParentheses.hpp" #include <stack> #include <vector> #include <algorithm> using namespace std; int LongestValidParentheses::longestValidParentheses(string s) { if (s.size() < 2) return 0; vector<int> dp(s.size(), 0); for (int i = 1; i < s.size(); i++) { if (s[i] == '(') dp[i] =...
```c++ #include "LongestValidParentheses.hpp" #include <stack> #include <vector> #include <algorithm> using namespace std; int LongestValidParentheses::longestValidParentheses(string s) { if (s.size() < 2) return 0; vector<int> dp(s.size(), 0); int ret = 0; for (int i = 1; i < s.size(); i++) { if (s[i] ...
40cde5c2-6172-4942-b260-3a91188b30c5
{ "language": "C++" }
```c++ #include "textfile.h" #include <QFile> TextFile::TextFile(QObject *parent) : QObject(parent), mValid(false) { } QString TextFile::text() const { return mText; } QString TextFile::source() const { return mSource; } void TextFile::setSource(const QString &file) { mValid = false; mSource...
```c++ #include "textfile.h" #include <QFile> #include <QTextStream> TextFile::TextFile(QObject *parent) : QObject(parent), mValid(false) { } QString TextFile::text() const { return mText; } QString TextFile::source() const { return mSource; } void TextFile::setSource(const QString &file) { mVal...
2baae762-b579-4a7e-abf4-e53b7e775d4a
{ "language": "C++" }
```c++ /* * Copyright (c) 2015-2018 Agalmic Ventures LLC (www.agalmicventures.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation th...
```c++ /* * Copyright (c) 2015-2018 Agalmic Ventures LLC (www.agalmicventures.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation th...
0a76e3ec-232b-4786-a971-aea4a6478cb1
{ "language": "C++" }
```c++ #include <iostream> #include <ccspec.h> using std::cout; using ccspec::core::formatters::DocumentationFormatter; using ccspec::core::ExampleGroup; using ccspec::core::Reporter; namespace spec { namespace matchers { extern ExampleGroup* eq_spec; } // namespace matchers } // namespace spec int main() { us...
```c++ #include <iostream> #include <ccspec.h> using std::cout; using ccspec::core::formatters::DocumentationFormatter; using ccspec::core::ExampleGroup; using ccspec::core::Reporter; namespace spec { namespace matchers { extern ExampleGroup* eq_spec; } // namespace matchers } // namespace spec int main() { us...
b3e5b522-1e51-4c57-ae1d-3b594015d200
{ "language": "C++" }
```c++ #include <Ab/Config.hpp> #include <Ab/LinearMemory.hpp> #include <Ab/Test/BasicTest.hpp> #include <gtest/gtest.h> namespace Ab::Test { class LinearMemoryTest : public BasicTest {}; TEST_F(LinearMemoryTest, init_and_kill) { LinearMemory m; } TEST_F(LinearMemoryTest, grow_three_times) { LinearMemory m; for (...
```c++ #include <Ab/Config.hpp> #include <Ab/LinearMemory.hpp> #include <gtest/gtest.h> namespace Ab::Test { TEST(LinearMemoryTest, init_and_kill) { LinearMemory m; } TEST(LinearMemoryTest, grow_three_times) { LinearMemory m; for (std::size_t i = 0; i < 3; i++) { m.grow(); } } } // namespace Ab::Test ```
5c02488b-f110-40b9-a09d-28f58256e2b9
{ "language": "C++" }
```c++ /* * Copyright (C) 2009, 2010, Gostai S.A.S. * * This software is provided "as is" without warranty of any kind, * either expressed or implied, including but not limited to the * implied warranties of fitness for a particular purpose. * * See the LICENSE file for more information. */ #include <libport/ba...
```c++ /* * Copyright (C) 2009, 2010, Gostai S.A.S. * * This software is provided "as is" without warranty of any kind, * either expressed or implied, including but not limited to the * implied warranties of fitness for a particular purpose. * * See the LICENSE file for more information. */ #include <libport/co...
b9aa354b-531c-4fc3-aa3d-fc1a0e5c4dc3
{ "language": "C++" }
```c++ #include "memory_manager.hpp" #include <malloc.h> #include <new> void CustomMemoryManager::Start() { this->numberOfAllocations = 0; this->peakAllocatedBytes = 0; this->allocatedBytes = 0; this->totalAllocatedBytes = 0; } void CustomMemoryManager::Stop(Result *result) { result->num_allocs = this->num...
```c++ #include "memory_manager.hpp" #include <malloc.h> #include <new> void CustomMemoryManager::Start() { this->numberOfAllocations = 0; this->peakAllocatedBytes = 0; this->allocatedBytes = 0; this->totalAllocatedBytes = 0; } void CustomMemoryManager::Stop(Result *result) { result->num_allocs = this->num...
315510e3-6ca9-4259-bec5-7fd6cdfd1163
{ "language": "C++" }
```c++ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2019 The Bitcoin Core developers // Copyright (c) 2021 The PIVX developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "util/validation.h" #i...
```c++ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2019 The Bitcoin Core developers // Copyright (c) 2021 The PIVX developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "util/validation.h" #i...
41682ffb-7598-439a-8e9e-8298c7e3bdec
{ "language": "C++" }
```c++ #include "board.h" #include <aery32/all.h> using namespace aery; #define ADC_PINMASK_ALLCHAN (0xff << 21) int main(void) { int errno; uint16_t result; /* conversion result in bits */ double volt; /* conversion in volts */ init_board(); gpio_init_pin(LED, GPIO_OUTPUT); gpio_init_pins(porta, ADC_PINM...
```c++ #include "board.h" #include <aery32/all.h> using namespace aery; #define ADC_PINMASK_ALLCHAN (0xff << 21) int main(void) { int errno; uint16_t result; /* conversion result in bits */ double volt; /* conversion in volts */ init_board(); gpio_init_pin(LED, GPIO_OUTPUT); gpio_init_pins(porta, ADC_PINM...
ad9d5519-b258-4c55-822a-d90c22f5866a
{ "language": "C++" }
```c++ // Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved. // Please see the AUTHORS file for details. Use of this source code is governed // by a BSD license that can be found in the LICENSE file. #include "distributed_queue.h" #include "common.h" #include "runtime_vars.h" #include "spinl...
```c++ // Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved. // Please see the AUTHORS file for details. Use of this source code is governed // by a BSD license that can be found in the LICENSE file. #include "distributed_queue.h" #include "common.h" #include "runtime_vars.h" #include "spinl...
9e2ce9ac-af3d-4fa6-93f4-dfa2264c677b
{ "language": "C++" }
```c++ // Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/renderer/net/prescient_networking_dispatcher.h" #include "chrome/common/render_messages.h" #include "content/public/renderer/rend...
```c++ // Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/renderer/net/prescient_networking_dispatcher.h" #include "base/metrics/field_trial.h" #include "chrome/common/render_messages.h" ...
53e31cfe-421e-48d0-a145-ad56add8d5ef
{ "language": "C++" }
```c++ #include "Manager.h" #include "Value.h" #include "api.h" Value * newValue(uint8_t valueType, uint64_t valueId) { Value * tmp = (Value *)malloc(sizeof(Value)); *tmp = (struct Value){0}; tmp->valueType = valueType; tmp->valueId = valueId; return tmp; } void freeValue(Value * value) { free(value); } ...
```c++ #include <stdlib.h> #include "Manager.h" #include "Value.h" #include "api.h" Value * newValue(uint8_t valueType, uint64_t valueId) { Value * tmp = (Value *)malloc(sizeof(Value)); *tmp = (struct Value){0}; tmp->valueType = valueType; tmp->valueId = valueId; return tmp; } void freeValue(Value * value)...
7796c4c8-bf96-46ff-aceb-bd4d89569985
{ "language": "C++" }
```c++ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===---------------------------------...
```c++ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===---------------------------------...
2863b546-7d1b-4359-9832-0e096166bd2d
{ "language": "C++" }
```c++ /* * Copyright 2010 MQWeb - Franky Braem * * Licensed under the EUPL, Version 1.1 or – as soon they * will be approved by the European Commission - subsequent * versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the * Licence. * You may obtain a copy of the Licenc...
```c++ /* * Copyright 2010 MQWeb - Franky Braem * * Licensed under the EUPL, Version 1.1 or – as soon they * will be approved by the European Commission - subsequent * versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the * Licence. * You may obtain a copy of the Licenc...
bd0682bd-af3f-427c-ac7f-e8e1120afb3c
{ "language": "C++" }
```c++ #include <iostream> #include "ccspec.h" using std::cout; using ccspec::core::formatters::DocumentationFormatter; using ccspec::core::ExampleGroup; using ccspec::core::Reporter; namespace spec { namespace matchers { extern ExampleGroup* eq_spec; } // namespace matchers } // namespace spec int main() { u...
```c++ #include <iostream> #include "ccspec.h" using std::cout; using ccspec::core::formatters::DocumentationFormatter; using ccspec::core::ExampleGroup; using ccspec::core::Reporter; namespace spec { namespace matchers { extern ExampleGroup* eq_spec; } // namespace matchers } // namespace spec int main() { D...
fd0bbf30-22ab-4dc4-9528-35c28063beb3
{ "language": "C++" }
```c++ // RUN: %llvmgxx %s -S -emit-llvm -O2 -o - | \ // RUN: ignore grep {eh\.selector.*One.*Two.*Three.*Four.*Five.*Six.*null} | \ // RUN: wc -l | grep {\[02\]} extern void X(void); struct One {}; struct Two {}; struct Three {}; struct Four {}; struct Five {}; struct Six {}; static void A(void) throw...
```c++ // RUN: %llvmgxx %s -S -O2 -o - | \ // RUN: ignore grep {eh\.selector.*One.*Two.*Three.*Four.*Five.*Six.*null} | \ // RUN: wc -l | grep {\[01\]} extern void X(void); struct One {}; struct Two {}; struct Three {}; struct Four {}; struct Five {}; struct Six {}; static void A(void) throw () { X()...
32755281-2493-48ea-a97a-b249a9189b49
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -std=c++1y -emit-llvm %s -o - | FileCheck %s // CHECK: @x = global {{.*}} zeroinitializer // CHECK: define {{.*}} @_Z1fv inline auto f() { int n = 0; // CHECK: load i32 // CHECK: store i32 // CHECK: ret return [=] () mutable { return ++n; }; } auto x = f(); template<typename T> a...
```c++ // RUN: %clang_cc1 -std=c++1y -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s // CHECK: @x = global {{.*}} zeroinitializer // CHECK: define {{.*}} @_Z1fv inline auto f() { int n = 0; // CHECK: load i32 // CHECK: store i32 // CHECK: ret return [=] () mutable { return ++n; }; } auto x = f()...
426dd09b-5814-4b85-b3e3-d856c092cf00
{ "language": "C++" }
```c++ #include <gtest/gtest.h> #include <sm/timing/NsecTimeUtilities.hpp> TEST( NsetTimeTestSuite, testChronoConversion ) { std::chrono::system_clock::time_point tp1 = std::chrono::system_clock::now(); sm::timing::NsecTime ns1 = sm::timing::chronoToNsec( tp1 ); std::chrono::system_clock::time_point tp2 = sm::t...
```c++ #include <cstdlib> #include <gtest/gtest.h> #include <sm/timing/NsecTimeUtilities.hpp> TEST( NsetTimeTestSuite, testChronoConversion ) { std::chrono::system_clock::time_point tp1 = std::chrono::system_clock::now(); sm::timing::NsecTime ns1 = sm::timing::chronoToNsec( tp1 ); std::chrono::system_clock::tim...
357c7091-0f7f-463a-8b93-07fec40b2332
{ "language": "C++" }
```c++ #include <iostream> #include "binarysearchtree.h" int main() { BinarySearchTree<int> tree; tree.insert(0); tree.insert(4); tree.insert(3); tree.insert(2); tree.insert(1); if (tree.contains(1)) { std::cout << "Item found" << std::endl; } int max = tree.findMax(); ...
```c++ #include <iostream> #include "binarysearchtree.h" // test binary search tree int main() { BinarySearchTree<int> tree; tree.insert(0); tree.insert(4); tree.insert(3); tree.insert(2); tree.insert(1); if (tree.contains(1)) { std::cout << "Item found" << std::endl; } ...
a6f4e01b-fec7-48a0-86c4-1ac48fb27c1f
{ "language": "C++" }
```c++ // RUN: %clang -g -S -emit-llvm %s -o - | FileCheck %s namespace A { #line 1 "foo.cpp" namespace B { int i; } } // CHECK: [[FILE:![0-9]*]] {{.*}}debug-info-namespace.cpp" // CHECK: [[VAR:![0-9]*]] = {{.*}}, metadata [[NS:![0-9]*]], metadata !"i", {{.*}} ; [ DW_TAG_variable ] [i] // CHECK: [[NS]] = {{.*}}, met...
```c++ // RUN: %clang -g -S -emit-llvm %s -o - | FileCheck %s namespace A { #line 1 "foo.cpp" namespace B { int i; } } // CHECK: [[FILE:![0-9]*]] {{.*}}debug-info-namespace.cpp" // CHECK: [[VAR:![0-9]*]] = {{.*}}, metadata [[NS:![0-9]*]], metadata !"i", {{.*}} ; [ DW_TAG_variable ] [i] // CHECK: [[NS]] = {{.*}}, met...
72e46c5f-5d4f-4374-9468-51698d98d090
{ "language": "C++" }
```c++ #include "Listener.hpp" using namespace Component; Listener::Listener(Entity* entity) : SuperComponent(entity) { } Json::Value Listener::Save() const { return Json::Value(); } void Listener::Load(const Json::Value& node) { } ``` Add placeholder value so listener node isn't null.
```c++ #include "Listener.hpp" using namespace Component; Listener::Listener(Entity* entity) : SuperComponent(entity) { } Json::Value Listener::Save() const { Json::Value component; component["placeholderValue"] = ""; return component; } void Listener::Load(const Json::Value& node) { } ```
d3f6826a-7319-41f9-8ca6-686325106645
{ "language": "C++" }
```c++ // Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/basictypes.h" #include "base/file_path.h" #include "build/build_config.h" #include "chrome/test/ui/ui_test.h" #include "net/base...
```c++ // Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/basictypes.h" #include "base/file_path.h" #include "build/build_config.h" #include "chrome/test/ui/ui_test.h" #include "net/base...
949f6047-6388-423f-93c8-3eea3d57de2e
{ "language": "C++" }
```c++ #include <ostream> #include <boost/filesystem.hpp> #include <papyrus/parser/PapyrusParser.h> #include <papyrus/PapyrusScript.h> #include <pex/PexWriter.h> int main(int argc, char* argv[]) { if (argc != 2) { printf("Invoke like: caprica.exe myFile.psc"); } #ifdef NDEBUG try { #endif std::string...
```c++ #include <ostream> #include <string> #include <boost/filesystem.hpp> #include <papyrus/parser/PapyrusParser.h> #include <papyrus/PapyrusScript.h> #include <pex/PexWriter.h> void compileScript(std::string filename) { auto parser = new caprica::papyrus::parser::PapyrusParser(filename); auto a = parser->par...
aae9ce72-beb3-4df4-9ca9-6390781cb976
{ "language": "C++" }
```c++ // Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "stdafx.h" #include <regex> #include "search_regex.h" RegexSearch::RegexSearch() : pattern_(NULL), patternLen_(0)...
```c++ // Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "stdafx.h" #include <regex> #include "search_regex.h" RegexSearch::RegexSearch() : pattern_(NULL), patternLen_(0)...
9d64a89e-6b0e-444b-ae89-a34736773b52
{ "language": "C++" }
```c++ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===---------------------------------...
```c++ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===---------------------------------...
25922a21-ba6a-4c3c-ac54-e187d5438bc8
{ "language": "C++" }
```c++ // Copyright 2015 Matt Heard // http://mattheard.net // matt@mattheard.net // @mattheard #include <opencv2/opencv.hpp> #include <iostream> #include <string> int main(int argc, char **argv) { using std::string; const int expectedNumArgs = 2; if (argc != expectedNumArgs) { const string cmdNam...
```c++ // Copyright 2015 Matt Heard // http://mattheard.net // matt@mattheard.net // @mattheard #include <opencv2/opencv.hpp> #include <iostream> #include <string> using cv::Mat; // TODO(mattheard): Implement me Mat convertToGrey(const Mat &src) { return Mat(); } int main(int argc, char **argv) { using std:...
615cf230-1f30-4398-9cd6-1eb64a1af952
{ "language": "C++" }
```c++ // Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/extensions/extension_apitest.h" IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Bookmarks) { // TODO(erikkay) no initial s...
```c++ // Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/extensions/extension_apitest.h" // TODO(brettw) bug 19866: this test is disabled because it is flaky. IN_PROC_BROWSER...
841ad3a9-9b4d-486d-bbfc-3eedb443e916
{ "language": "C++" }
```c++ #ifdef WIN32 #include "anh/plugin/platform/win32_library.h" #include <exception> #include <sstream> #include <Windows.h> #include <boost/filesystem.hpp> using namespace anh::plugin; using namespace boost::filesystem; using namespace platform; using namespace std; shared_ptr<Win32Library> Win32Library::Loa...
```c++ #ifdef WIN32 #include "anh/plugin/platform/win32_library.h" #include <exception> #include <sstream> #include <Windows.h> #include <boost/filesystem.hpp> using namespace anh::plugin; using namespace boost::filesystem; using namespace platform; using namespace std; shared_ptr<Win32Library> Win32Library::Loa...
4e721b02-02f3-4120-a2ec-109569cece3b
{ "language": "C++" }
```c++ /* This file is part of cpp-ethereum. cpp-ethereum is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. cpp-ethereum is distributed...
```c++ /* This file is part of cpp-ethereum. cpp-ethereum is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. cpp-ethereum is distributed...
a65f123d-5d2f-4238-833b-7ad606f19bc4
{ "language": "C++" }
```c++ // // kern_start.cpp // AppleALC // // Copyright © 2016-2017 vit9696. All rights reserved. // #include <Headers/plugin_start.hpp> #include <Headers/kern_api.hpp> #include "kern_alc.hpp" static AlcEnabler alc; static const char *bootargOff[] { "-alcoff", "-x" }; static const char *bootargDebug[] { "-al...
```c++ // // kern_start.cpp // AppleALC // // Copyright © 2016-2017 vit9696. All rights reserved. // #include <Headers/plugin_start.hpp> #include <Headers/kern_api.hpp> #include "kern_alc.hpp" static AlcEnabler alc; static const char *bootargOff[] { "-alcoff" }; static const char *bootargDebug[] { "-alcdbg" }...
7a0d38f9-fb1b-4dc7-a9c7-dc25cac2736b
{ "language": "C++" }
```c++ // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "config.h" #include "core/animation/css/CSSTransitionData.h" #include "core/animation/Timing.h" namespace blink { CSSTransitionData::CS...
```c++ // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "config.h" #include "core/animation/css/CSSTransitionData.h" #include "core/animation/Timing.h" namespace blink { CSSTransitionData::CS...
0b744433-ab01-49c1-b231-0504dc37ce78
{ "language": "C++" }
```c++ // // Copyright (C) 2016 University of Amsterdam // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // Thi...
```c++ // // Copyright (C) 2016 University of Amsterdam // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // Thi...
2638fe56-dfa9-45ac-b6a8-f762e1aa407b
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -emit-llvm -o - -O1 %s | FileCheck %s // Check that we generate TBAA for vtable pointer loads and stores. struct A { virtual int foo() const ; virtual ~A(); }; void CreateA() { new A; } void CallFoo(A *a) { a->foo(); } // CHECK: %vtable = load {{.*}} !tbaa !0 // CHECK: store {{.*}} ...
```c++ // RUN: %clang_cc1 -emit-llvm -o - -O1 %s | FileCheck %s // Check that we generate TBAA for vtable pointer loads and stores. struct A { virtual int foo() const ; virtual ~A(); }; void CreateA() { new A; } void CallFoo(A *a) { a->foo(); } // CHECK: %{{.*}} = load {{.*}} !tbaa !0 // CHECK: store {{.*}} ...
99b56f24-a6e5-49a4-bbab-fddfd9af8561
{ "language": "C++" }
```c++ // Copyright (c) 2009 - Decho Corp. #include "mordor/common/pch.h" #include "stream.h" #include <string.h> size_t Stream::write(const char *sz) { return write(sz, strlen(sz)); } size_t Stream::write(const void *b, size_t len) { Buffer buf; buf.copyIn(b, len); return write(buf, len); } std::...
```c++ // Copyright (c) 2009 - Decho Corp. #include "mordor/common/pch.h" #include "stream.h" #include <string.h> size_t Stream::write(const char *sz) { return write(sz, strlen(sz)); } size_t Stream::write(const void *b, size_t len) { Buffer buf; buf.copyIn(b, len); return write(buf, len); } std::...
fcc3f7bc-1491-4c3a-9f88-9755c0801eac
{ "language": "C++" }
```c++ #include <iostream> #include "Student.h" int main(int argc, char **argv){ Student c("Joe Schmoe", 12345); std::cout << c.getNumber() << ": " << c.getName() << std::endl; int num_grades = c.getNumGrades(); float * grades = c.getGrades(); for(int i=0; i<num_grades; i++){ std::cout << grades[i] << "\t"; }...
```c++ #include <iostream> #include "Student.h" int main(int argc, char **argv){ Student c("Joe Schmoe", 12345); std::cout << c.getNumber() << ": " << c.getName() << std::endl; int num_grades = c.getNumGrades(); float * grades = c.getGrades(); for(int i=0; i<num_grades; i++){ std::cout << grades[i] << "\t"; }...
d400c3ec-262b-4520-b6c0-9c6f902ab6ee
{ "language": "C++" }
```c++ //===-- GDBRemoteTestUtils.cpp ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===-- GDBRemoteTestUtils.cpp ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
d9f9684a-aacf-4908-90ec-06485e240b24
{ "language": "C++" }
```c++ // // Created by Sam on 9/25/2017. // #include "../../../include/Game/Core/Board.h" #include "../../../include/Game/Core/Card.h" #include "../../../include/Game/Derived/Card/Creature.h" #include "../../../include/Game/Derived/Containers/CreatureZone.h" #include "../../../include/Game/Derived/Containers/Deck.h" ...
```c++ // // Created by Sam on 9/25/2017. // #include "../../../include/Game/Core/Board.h" #include "../../../include/Game/Core/Card.h" #include "../../../include/Game/Derived/Card/Creature.h" #include "../../../include/Game/Derived/Containers/CreatureZone.h" #include "../../../include/Game/Derived/Containers/Deck.h" ...
1be9ba0e-ad9c-4936-a015-dd968d43870e
{ "language": "C++" }
```c++ #include "frame.hpp" namespace ph { Frame::Frame(QWebFrame *frame, QObject *parent): QObject(parent) { p_frame = frame; } Frame::~Frame() {} QByteArray Frame::toHtml() { return p_frame->toHtml().toUtf8(); } QByteArray Frame::captureImage(const char *format, int quality) { p_frame->page()->setVi...
```c++ #include "frame.hpp" namespace ph { Frame::Frame(QWebFrame *frame, QObject *parent): QObject(parent) { p_frame = frame; } Frame::~Frame() {} QByteArray Frame::toHtml() { return p_frame->toHtml().toUtf8(); } QByteArray Frame::captureImage(const char *format, int quality) { p_frame->page()->setVi...
c1de54a6-7fe8-4385-b413-93389052b994
{ "language": "C++" }
```c++ /* * FileHelper.cpp * * Created on: 08.06.2016 * Author: hartung */ #include <boost/filesystem.hpp> #include "util/FileHelper.hpp" namespace Util { std::string FileHelper::find(const std::string & path, const std::string & fileName, const bool & recursive) { namespace fs = boost::fi...
```c++ /* * FileHelper.cpp * * Created on: 08.06.2016 * Author: hartung */ #include <boost/filesystem.hpp> #include "util/FileHelper.hpp" namespace Util { std::string FileHelper::find(const std::string & path, const std::string & fileName, const bool & recursive) { namespace fs = boost::fi...
5cca9838-4d89-4087-9a18-5f02108c0ee3
{ "language": "C++" }
```c++ #include "VM.hpp" #include <fstream> #include <iterator> #include "IoDevice.hpp" namespace model { VM::VM( IoDevice& ioDevice ) : m_ioDevice{ ioDevice } , m_cpu{ m_mmu, m_ioDevice, m_rng } { } bool VM::loadRom( const std::string& fileName ) { std::ifstream in{ fileName, std::ios::binary }; if ( in....
```c++ #include "VM.hpp" #include <fstream> #include <iterator> #include "IoDevice.hpp" namespace model { VM::VM( IoDevice& ioDevice ) : m_ioDevice{ ioDevice } , m_cpu{ m_mmu, m_ioDevice, m_rng } { } bool VM::loadRom( const std::string& fileName ) { std::ifstream in{ fileName, std::ios::binary }; if ( in....
26f75725-6f53-4ca1-aecb-ce0dbf87d670
{ "language": "C++" }
```c++ // RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include <stdio.h> #include <string.h> #include <malloc.h> int main() { char *ptr = _strdup("Hello"); int subscript = 1; ptr[subscript] = '3'; printf("%s\n", ptr); fflush(0); // CHECK: H3llo subscript = -1; ptr[subscript...
```c++ // RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s #include <stdio.h> #include <string.h> #include <malloc.h> int main() { char *ptr = _strdup("Hello"); int subscript = 1; ptr[subscript] = '3'; printf("%s\n", ptr); fflush(0); // CHECK: H3llo subscript = -1; ptr[subscript...
489c6653-b296-47d4-9eb2-12e8e031a914
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -fsyntax-only -verify %s class c { virtual void f1(const char* a, ...) __attribute__ (( __format__(__printf__,2,3) )) = 0; virtual void f2(const char* a, ...) __attribute__ (( __format__(__printf__,2,3) )) {} }; ``` Convert this file to not have Windows line endings -- ...
```c++ // RUN: %clang_cc1 -fsyntax-only -verify %s class c { virtual void f1(const char* a, ...) __attribute__ (( __format__(__printf__,2,3) )) = 0; virtual void f2(const char* a, ...) __attribute__ (( __format__(__printf__,2,3) )) {} }; ```
958aa1bf-3154-412b-8de3-9d7a5fe06b5f
{ "language": "C++" }
```c++ // Copyright 2015 Nikita Chudinov #include <iostream> #include "argument_parser.h" #include "daemon.h" #include "ipc.h" int main(int argc, char *argv[]) { ArgumentParser arguments(argc, argv); switch (arguments.GetMode()) { case ArgumentParser::START: Daemon::Start(); b...
```c++ // Copyright 2015 Nikita Chudinov #include <iostream> #include "argument_parser.h" #include "daemon.h" #include "ipc.h" int main(int argc, char *argv[]) { ArgumentParser arguments(argc, argv); int status = 0; switch (arguments.GetMode()) { case ArgumentParser::START: Daemon::St...
05b9b3e0-b24c-46d8-b030-03c97d8ffc40
{ "language": "C++" }
```c++ #include "./Sphere.hpp" #include "./misc.hpp" #include <algorithm> #include <cmath> namespace yks { Optional<float> intersect(const vec3& origin, float radius, const Ray& r) { const vec3 o = r.origin - origin; const vec3 v = r.direction; float t1, t2; const int solutions = solve_quadratic(dot(v, v), ...
```c++ #include "./Sphere.hpp" #include "./misc.hpp" #include <algorithm> #include <cmath> namespace yks { Optional<float> intersect(const vec3& origin, float radius, const Ray& r) { const vec3 o = r.origin - origin; const vec3 v = r.direction; float t1, t2; const int solutions = solve_quadratic(dot(v, v), ...
a9088add-e48a-40bd-987a-39f4bfdd567c
{ "language": "C++" }
```c++ #include "main_menu_state.hpp" #include "game_state.hpp" namespace Quoridor { MainMenuState::MainMenuState() { } MainMenuState::~MainMenuState() { } void MainMenuState::handle_events(StateManager *stm, std::shared_ptr<UI::UIImpl> ui) { UI::Event ev; if (ui->poll_event(&ev)) { switch (ev) { ...
```c++ #include "main_menu_state.hpp" #include "start_game_state.hpp" namespace Quoridor { MainMenuState::MainMenuState() { } MainMenuState::~MainMenuState() { } void MainMenuState::handle_events(StateManager *stm, std::shared_ptr<UI::UIImpl> ui) { UI::Event ev; if (ui->poll_event(&ev)) { sw...
f7340547-b7b8-406b-bb81-ac3d25312e58
{ "language": "C++" }
```c++ // -*- C++ -*- //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===------------------...
```c++ // -*- C++ -*- //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===------------------...
2cebdaff-2feb-434c-a3d7-407869b62f64
{ "language": "C++" }
```c++ #include "runtime_internal.h" #define INLINE inline __attribute__((weak)) __attribute__((always_inline)) __attribute__((used)) extern "C" { INLINE void call_destructor(void *user_context, void (*fn)(void *user_context, void *object), void **object) { // Call the function if (*object) { fn(user...
```c++ #include "runtime_internal.h" #define INLINE inline __attribute__((weak)) __attribute__((always_inline)) __attribute__((used)) extern "C" { INLINE void call_destructor(void *user_context, void (*fn)(void *user_context, void *object), void **object) { void *o = *object; *object = NULL; // Call the ...
7033d2f2-a2a4-43be-b907-5f1581d82e28
{ "language": "C++" }
```c++ #include <vw/Core/System.h> #include <vw/Core/Cache.h> #include <vw/Core/Log.h> #include <vw/Core/Settings.h> #include <vw/Core/Stopwatch.h> namespace { vw::RunOnce core_once = VW_RUNONCE_INIT; vw::Cache* cache_ptr = 0; vw::Settings* settings_ptr = 0; vw::Log* log_ptr = 0;...
```c++ #include <vw/Core/System.h> #include <vw/Core/Cache.h> #include <vw/Core/Log.h> #include <vw/Core/Settings.h> #include <vw/Core/Stopwatch.h> #define FUNC(Name, Type, Code) \ namespace { \ vw::RunOnce Name ## _once = VW_RUNONCE_INIT; \ Type* Name ...
f59a392c-5102-4527-8758-c687a3ea34c5
{ "language": "C++" }
```c++ // Copyright (c) 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/app/chrome_watcher_command_line_win.h" #include <windows.h> #include "base/command_line.h" #include "base/files/file_path.h"...
```c++ // Copyright (c) 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/app/chrome_watcher_command_line_win.h" #include <windows.h> #include "base/command_line.h" #include "base/files/file_path.h"...