doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
54a7abaa-d75b-4bbb-b82d-2ca170e49bf8 | {
"language": "C++"
} | ```c++
#include "Server.h"
#include "IgnoreDebugOutput.h"
#include "StdinNotifier.h"
#include <QApplication>
#include <iostream>
#ifdef Q_OS_UNIX
#include <unistd.h>
#endif
int main(int argc, char **argv) {
#ifdef Q_OS_UNIX
if (setpgid(0, 0) < 0) {
std::cerr << "Unable to set new process group." << std::endl;
... | ```c++
#include "Server.h"
#include "IgnoreDebugOutput.h"
#include "StdinNotifier.h"
#include <QApplication>
#include <iostream>
#ifdef Q_OS_UNIX
#include <unistd.h>
#endif
int main(int argc, char **argv) {
#ifdef Q_OS_UNIX
if (setpgid(0, 0) < 0) {
std::cerr << "Unable to set new process group." << std::endl;
... |
8cdc7e2c-3d9b-4581-b641-814ef08af0c2 | {
"language": "C++"
} | ```c++
#include <QtCore/QSettings>
#include <QtCore/QVariant>
#include <QtGui/QApplication>
#include <QtGui/QFont>
#include <memory>
extern "C" {
#include <libxslt/xslt.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <libexslt/exslt.h>
}
#include "DactMainWindow.h"
int main(int argc, char *argv[])
... | ```c++
#include <QtCore/QSettings>
#include <QtCore/QVariant>
#include <QtGui/QApplication>
#include <QtGui/QFont>
#include <QScopedPointer>
extern "C" {
#include <libxslt/xslt.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <libexslt/exslt.h>
}
#include "DactMainWindow.h"
int main(int argc, char *a... |
acc559ad-269b-4171-8455-82147a2c1e29 | {
"language": "C++"
} | ```c++
#include<cmath>
#include<iostream>
using namespace std;
bool isPrimeBruteForce(int x)
{
if (x < 2)
return false;
float sqroot_x = sqrt(x);
for(int i=0; i <= sqroot_x; i++) { /* If there were only factors above the square root of x, they would be bigger than x itself. */
if (x%i==0)
return false;
}
... | ```c++
#include<cmath>
#include<iostream>
using namespace std;
bool isPrimeBruteForce(int x)
{
if (x < 2)
return false;
float sqroot_x = sqrt(x);
for(int i=0; i <= sqroot_x; i++) { /* If there were only factors above the square root of x, they would be bigger than x itself. */
if (x%i==0)
return false;
}
... |
2e9f57ec-e1ac-428c-9af2-d03c57ec2461 | {
"language": "C++"
} | ```c++
#include "WebSocketWrapper.hpp"
#include <thread>
#include <iostream>
using namespace rtcdcpp;
WebSocketWrapper::WebSocketWrapper(std::string url) : url(url), send_queue() { ; }
WebSocketWrapper::~WebSocketWrapper() { delete this->ws; }
bool WebSocketWrapper::Initialize() {
this->ws = WebSocket::from_url(t... | ```c++
#include "WebSocketWrapper.hpp"
#include <thread>
#include <iostream>
using namespace rtcdcpp;
WebSocketWrapper::WebSocketWrapper(std::string url) : url(url), send_queue() { ; }
WebSocketWrapper::~WebSocketWrapper() { delete this->ws; }
bool WebSocketWrapper::Initialize() {
this->ws = WebSocket::from_url(t... |
96ada84c-4245-4012-9789-9ed2de716bcf | {
"language": "C++"
} | ```c++
#include <iostream>
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/util/json_util.h"
#include "src/protobuf/test.pb.h"
int main() {
// verify link and compile versions are the same
GOOGLE_PROTOBUF_VERIFY_VERSION;
// testing absl
std::cout << absl::St... | ```c++
#include <iostream>
#include <string>
// #include "absl/strings/str_cat.h"
// #include "absl/strings/string_view.h"
#include "google/protobuf/util/json_util.h"
#include "src/protobuf/bmv2/program.pb.h"
void ReadStdin(std::string& str) {
std::istreambuf_iterator<char> cin_iterator{std::cin};
std::istreambu... |
fc682f87-70be-4186-bbc7-ab1c757bcfd1 | {
"language": "C++"
} | ```c++
#include <iostream>
#include "Board.h"
int main()
{
Board b(10, 10);
b.fillRandomly(10);
std::cout << "main executed" << std::endl;
return 0;
}
```
Use the engine to create a game window | ```c++
#include <cstdio>
#include "Board.h"
#include "AGE/Engine.h"
int main()
{
AGE::Engine engine;
printf("Initializing...\n");
if (!engine.init())
{
printf("Advanced Game Engine failed to initialize. Exiting.\n");
exit(1);
}
printf("Initialization complete.\nLoading the media...\n");
if (!e... |
a625b408-b573-477d-8d91-bc285b9dc2b3 | {
"language": "C++"
} | ```c++
/*
* BasicLayout.cpp
*
* Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
* Copyright 2000, Bastiaan Bakker. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#include "PortabilityImpl.hh"
#include <log4cpp/BasicLayout.hh>
#include <log4... | ```c++
/*
* BasicLayout.cpp
*
* Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
* Copyright 2000, Bastiaan Bakker. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#include "PortabilityImpl.hh"
#include <log4cpp/BasicLayout.hh>
#include <log4... |
6fbd164e-d21e-4aab-b486-d6c0f1e27440 | {
"language": "C++"
} | ```c++
#include "Interpreter.hpp"
#include "modules/error-handler/ErrorHandler.hpp"
#include "modules/lexer/Lexer.hpp"
#include <iostream>
using Interpreter = tkom::Interpreter;
using ErrorHandler = tkom::modules::ErrorHandler;
using Lexer = tkom::modules::Lexer;
Interpreter::Interpreter(const std::vector<std::stri... | ```c++
#include "Interpreter.hpp"
#include "modules/error-handler/ErrorHandler.hpp"
#include "modules/lexer/Lexer.hpp"
#include "modules/parser/Parser.hpp"
using Interpreter = tkom::Interpreter;
using ErrorHandler = tkom::modules::ErrorHandler;
using Lexer = tkom::modules::Lexer;
using Parser = tkom::modules::Parser;... |
6e2ddfe9-528c-45ae-82f4-ce0486396850 | {
"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 "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
IN_PROC_BR... | ```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 "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
// Flaky, h... |
9807f26d-2265-4d64-b4a5-867f988a3741 | {
"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/test/chromedriver/chrome/device_metrics.h"
DeviceMetrics::DeviceMetrics(int width, int height, double device_scale_factor)
: wi... | ```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/test/chromedriver/chrome/device_metrics.h"
DeviceMetrics::DeviceMetrics(int width, int height, double device_scale_factor)
: wi... |
ff9c18b4-a33e-484e-bd10-60dc1f2ed241 | {
"language": "C++"
} | ```c++
#include "scene/scenegroup.hpp"
#include <algorithm>
using namespace scene;
SceneGroup::SceneGroup(unsigned int octreeLevels) {
addOctreeLayers(octreeLevels);
}
void SceneGroup::addOctreeLayers(unsigned int levels) {
childGroups.reset(new std::array<SceneGroup,8>);
std::for_each(childGroups->begin(), chi... | ```c++
#include "scene/scenegroup.hpp"
#include <algorithm>
using namespace scene;
SceneGroup::SceneGroup(unsigned int octreeLevels) {
addOctreeLayers(octreeLevels);
}
void SceneGroup::addOctreeLayers(unsigned int levels) {
if(levels != 0) {
childGroups.reset(new std::array<SceneGroup,8>);
std::for_each(chil... |
844c0956-267b-4993-a9a9-92152a5a6593 | {
"language": "C++"
} | ```c++
// RUN: %clang_cl_asan -O0 %s -Fe%t
// RUN: env ASAN_OPTIONS=handle_segv=0 %run %t 2>&1 | FileCheck %s --check-prefix=USER
// RUN: env ASAN_OPTIONS=handle_segv=1 not %run %t 2>&1 | FileCheck %s --check-prefix=ASAN
// Test the default.
// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=ASAN
// This test exit... | ```c++
// RUN: %clang_cl_asan -O0 %s -Fe%t
// RUN: env ASAN_OPTIONS=handle_segv=0 %run %t 2>&1 | FileCheck %s --check-prefix=USER
// RUN: env ASAN_OPTIONS=handle_segv=1 not %run %t 2>&1 | FileCheck %s --check-prefix=ASAN
// Test the default.
// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=ASAN
// This test exit... |
8f38d6f6-dfa0-40d6-aa61-10f75168088c | {
"language": "C++"
} | ```c++
#include "singletons/Emotes.hpp"
#include "Application.hpp"
#include "controllers/accounts/AccountController.hpp"
namespace chatterino {
void Emotes::initialize(Application &app)
{
app.accounts->twitch.currentUserChanged.connect([this, &app] {
auto currentUser = app.accounts->twitch.getCurrent();
... | ```c++
#include "singletons/Emotes.hpp"
#include "Application.hpp"
#include "controllers/accounts/AccountController.hpp"
namespace chatterino {
void Emotes::initialize(Application &app)
{
const auto refreshTwitchEmotes = [this, &app] {
auto currentUser = app.accounts->twitch.getCurrent();
assert(... |
9e90a69e-3571-4cda-bd36-751d7ae09e7c | {
"language": "C++"
} | ```c++
#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE flatten_tests
#include <boost/test/unit_test.hpp>
#include "flatten/flatten.hpp"
BOOST_AUTO_TEST_CASE(flatten_tests)
{
}
```
Add test for Example 1. | ```c++
#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE flatten_tests
#include <boost/test/unit_test.hpp>
#include <list>
#include <vector>
#include <map>
#include "flatten/flatten.hpp"
typedef std::vector<int> IntList;
typedef std::vector<IntList> IntListList;
typedef std::vector<IntLis... |
60d4a7c3-8288-4e70-b590-196756386401 | {
"language": "C++"
} | ```c++
#if defined(__x86_64__) || defined(_M_X64)
X86_64
#elif defined(__i386__) || defined(__i386) || defined(_M_IX86)
X86_32
#elif defined(__aarch64__) || defined(__ARM_ARCH_ISA_A64)
ARM64
#elif defined(__arm__) || defined(_M_ARM) || defined(__ARM_ARCH_7A__)
ARM32
#elif defined(__powerpc64__) || defined(... | ```c++
#if defined(__x86_64__) || defined(_M_X64)
X86_64
#elif defined(__i386__) || defined(__i386) || defined(_M_IX86)
X86_32
#elif defined(__aarch64__) || defined(__ARM_ARCH_ISA_A64)
ARM64
#elif defined(__arm__) || defined(_M_ARM) || defined(__ARM_ARCH_7A__)
ARM32
#elif defined(__powerpc64__) || defined(... |
d170f839-ee90-476a-a013-567d708dbf91 | {
"language": "C++"
} | ```c++
// ========================================================================== //
// This file is part of DO++, a basic set of libraries in C++ for computer
// vision.
//
// Copyright (C) 2013 David Ok <david.ok8@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License v. ... | ```c++
// ========================================================================== //
// This file is part of DO++, a basic set of libraries in C++ for computer
// vision.
//
// Copyright (C) 2013 David Ok <david.ok8@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License v. ... |
dbd1db99-fd50-4583-97e0-28c2d5b14272 | {
"language": "C++"
} | ```c++
/**
** Test code for libport/shared-ptr.hh features.
*/
#include <libport/ref-counted.hh>
#include <libport/shared-ptr.hh>
#define INSTANCES(N) assert(Counted::instances == N)
using libport::shared_ptr;
struct Counted : libport::RefCounted
{
Counted () : libport::RefCounted() { ++instances; }
virtual ~... | ```c++
/**
** Test code for libport/shared-ptr.hh features.
*/
#include <libport/ref-counted.hh>
#include <libport/shared-ptr.hh>
#define INSTANCES(N) assert(Counted::instances == N)
using libport::shared_ptr;
struct Counted : libport::RefCounted
{
Counted () : libport::RefCounted() { ++instances; }
virtual ~... |
aadf7543-1ff0-44e4-861b-fe7dedc54f62 | {
"language": "C++"
} | ```c++
#include <iostream>
#include <cstdlib>
#include "NTClient.h"
using namespace std;
void initBot() {
NTClient nclient = NTClient(20, 0.89);
nclient.login("sascf3", "123asd123"); // Throw-away account
nclient.connect();
}
int main(int argc, char** argv) {
srand(static_cast<unsigned int>(time(0)));
initBot();
... | ```c++
#include <iostream>
#include <cstdlib>
#include <fstream>
#include "NTClient.h"
#include "colors.h"
#include "json.hpp"
using namespace std;
void initBot(string username, string password, int wpm, double acc) {
NTClient nclient = NTClient(wpm, acc);
nclient.login(username, password);
nclient.connect();
}
voi... |
cd9439c1-a724-4117-9529-a39ebf96c6ec | {
"language": "C++"
} | ```c++
#include <iostream>
int main(int argc, char** argv) {
std::cout << "Hello Lamure Virtual Texture!\n";
return 0;
}
```
Implement first basic black window setup without any content | ```c++
#include <iostream>
// scism shit
#include <scm/core.h>
#include <scm/log.h>
#include <scm/core/pointer_types.h>
#include <scm/core/io/tools.h>
#include <scm/core/time/accum_timer.h>
#include <scm/core/time/high_res_timer.h>
#include <scm/gl_core.h>
#include <scm/gl_util/data/imaging/texture_loade... |
60d30868-2cc0-48f1-beda-df6afb785f17 | {
"language": "C++"
} | ```c++
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE JPetEventTest
#include <boost/test/unit_test.hpp>
#include "../JPetAnalysisTools/JPetAnalysisTools.h"
BOOST_AUTO_TEST_SUITE(FirstSuite)
BOOST_AUTO_TEST_CASE(constructor_getHitsOrderedByTime)
{
std::vector<JPetHit> hits(4);
hits[0].setTime(2);
hits[1... | ```c++
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE JPetEventTest
#include <boost/test/unit_test.hpp>
#include "../JPetAnalysisTools/JPetAnalysisTools.h"
BOOST_AUTO_TEST_SUITE(FirstSuite)
BOOST_AUTO_TEST_CASE(constructor_getHitsOrderedByTime)
{
std::vector<JPetHit> hits(4);
hits[0].setTime(2);
hits[1... |
abc799ac-4f72-47cb-9c09-5585db8f5513 | {
"language": "C++"
} | ```c++
#include "AppInfo.h"
#include "Builder.h"
#include "LibInfoDySySim.h"
#include <fstream>
#include <iomanip>
#include <iostream>
#include <string>
namespace dss = dysysim;
int main(int argc, char *argv[])
{
std::cout << "-- " APPNAME_VERSION " " << std::string(50, '-') << std::endl
<< "-- uses ... | ```c++
#include "AppInfo.h"
#include "Builder.h"
#include "LibInfoDySySim.h"
#include <fstream>
#include <iomanip>
#include <iostream>
#include <string>
namespace dss = dysysim;
int main(int argc, char *argv[])
{
std::cout << "-- " APPNAME_VERSION " " << std::string(50, '-') << std::endl
<< "-- uses ... |
cff7f429-b938-4082-b643-fd4e0e50f99b | {
"language": "C++"
} | ```c++
//===--- ThreadSanitizer.cpp - Thread Sanitizer support -------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swif... | ```c++
//===--- ThreadSanitizer.cpp - Thread Sanitizer support -------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swif... |
a82aec19-cea6-44cc-a9a1-e4c425530db8 | {
"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.
//
//===---------------------------------... |
986a0752-5666-4b25-ab33-0c1a4c452c29 | {
"language": "C++"
} | ```c++
/* **********************************************************
* Copyright (c) 2011 Google, Inc. All rights reserved.
* **********************************************************/
/* Dr. Memory: the memory debugger
*
* This library is free software; you can redistribute it and/or
* modify it under t... | ```c++
/* **********************************************************
* Copyright (c) 2011 Google, Inc. All rights reserved.
* **********************************************************/
/* Dr. Memory: the memory debugger
*
* This library is free software; you can redistribute it and/or
* modify it under t... |
982fd558-d532-479a-bb7b-452885c8b703 | {
"language": "C++"
} | ```c++
// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include <autowiring/config_descriptor.h>
#include <autowiring/config.h>
#include <autowiring/ConfigRegistry.h>
#include <autowiring/observable.h>
namespace aw = autowiring;
class AutoConfig_SliderTest :
public testing::Tes... | ```c++
// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include <autowiring/config_descriptor.h>
#include <autowiring/config.h>
#include <autowiring/ConfigRegistry.h>
#include <autowiring/observable.h>
namespace aw = autowiring;
class AutoConfig_SliderTest :
public testing::Tes... |
8a605037-0e92-46e0-b931-17293e258d9b | {
"language": "C++"
} | ```c++
//=======================================================================
// Copyright Baptiste Wicht 2011.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//==============================================... | ```c++
//=======================================================================
// Copyright Baptiste Wicht 2011.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//==============================================... |
442d72c8-b61c-470c-80af-59c08cb4a06b | {
"language": "C++"
} | ```c++
//===-- PerfHelperTest.cpp --------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... | ```c++
//===-- PerfHelperTest.cpp --------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... |
e419433c-d716-4b98-989b-e7b00d6b92b1 | {
"language": "C++"
} | ```c++
/* Copyright 2015 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 2015 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... |
25ee5dee-b42b-4563-b937-d32f2fe5b759 | {
"language": "C++"
} | ```c++
// Check existence of a key
// C++11
#include <map>
#include <string>
int main()
{
std::map<string, int> m = {{"a", 1}, {"b", 2}, {"c", 3}};
if (m.count("b"))
{
// We know "b" is in m
}
}
// Check if a particular key is in an associative container.
//
// On [9], we create a [`std::map`](cpp/c... | ```c++
// Check existence of a key
// C++11
#include <map>
#include <string>
int main()
{
std::map<std::string, int> m = {{"a", 1}, {"b", 2}, {"c", 3}};
if (m.count("b"))
{
// We know "b" is in m
}
}
// Check if a particular key is in an associative container.
//
// On [9], we create a [`std::map`](cpp/cont... |
e9d72f5d-de69-49aa-950b-a85a8bb38121 | {
"language": "C++"
} | ```c++
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QDir>
#include <QFile>
#include <QFileInfo>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QQmlApplicationEngine engine;
if (argc < 2) {
printf("Usage: OwaViewer [directory]\n");
return 1;
}
QDir dirPath(argv[1]);
... | ```c++
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QDir>
#include <QFile>
#include <QFileInfo>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QQmlApplicationEngine engine;
if (argc < 2) {
printf("Usage: OwaViewer [directory]\n");
printf(" or: OwaViewer [File]\n");
... |
5a060230-29cb-4d9a-bd6d-f716d2f79987 | {
"language": "C++"
} | ```c++
#include "cameras/itf/pinhole_camera.h"
#include "core/itf/film.h"
#include "core/itf/ray.h"
#include "core/itf/sampling.h"
#include <iostream>
using namespace lb;
/// Constructs a pinhole camera, where the image plane's origin is pointed to
/// the by the look at vector relative from the camera's location. ... | ```c++
#include "cameras/itf/pinhole_camera.h"
#include "core/itf/film.h"
#include "core/itf/ray.h"
#include "core/itf/sampling.h"
using namespace lb;
/// Constructs a pinhole camera, where the image plane's origin is pointed to
/// the by the look at vector relative from the camera's location. Together with
/// the... |
2fccad62-33b2-480b-8ea0-ef46f5f2477a | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -fsyntax-only -verify %s
// Various tests for -fno-exceptions
typedef __typeof(sizeof(int)) size_t;
namespace test0 {
// rdar://problem/7878149
class Foo {
public:
void* operator new(size_t x);
private:
void operator delete(void *x);
};
void test() {
// Under -fexce... | ```c++
// RUN: %clang_cc1 -fsyntax-only -verify %s
// Various tests for -fno-exceptions
typedef __SIZE_TYPE__ size_t;
namespace test0 {
// rdar://problem/7878149
class Foo {
public:
void* operator new(size_t x);
private:
void operator delete(void *x);
};
void test() {
// Under -fexceptions, ... |
85a2fd3a-2948-4795-a468-5e1e96bc3cad | {
"language": "C++"
} | ```c++
/*
Copyright (c), Helios
All rights reserved.
Distributed under a permissive license. See COPYING.txt for details.
*/
#include "ImageViewerApplication.h"
int main(int argc, char **argv){
try{
initialize_supported_extensions();
ImageViewerApplication app(argc, argv, "BorderlessViewer" + get_pe... | ```c++
/*
Copyright (c), Helios
All rights reserved.
Distributed under a permissive license. See COPYING.txt for details.
*/
#include "ImageViewerApplication.h"
#include <QImageReader>
int main(int argc, char **argv){
try{
//Set the limit to 1 GiB.
QImageReader::setAllocationLimit(1024);
initial... |
4df85fb6-f845-487a-9fe9-6113696a1b04 | {
"language": "C++"
} | ```c++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
// SOComWindowPeer.cpp : Implementation of CHelpApp and DLL registration.
#include "stdafx2.h"
#include "so_activex.h"
#include "SOComWindowPeer.h"
/////////////////////////////////////////////////////////////////////////////
//
S... | ```c++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
// SOComWindowPeer.cpp : Implementation of CHelpApp and DLL registration.
#include "stdafx2.h"
#include "so_activex.h"
#include "SOComWindowPeer.h"
/////////////////////////////////////////////////////////////////////////////
//
S... |
a44ee186-ca61-4ebe-9190-33bde4d4bc7b | {
"language": "C++"
} | ```c++
// Copyright (c) 2012 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_input_method_api.h"
#include "base/values.h"
#include "chrome/browser/chromeos/input_method/inpu... | ```c++
// Copyright (c) 2012 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_input_method_api.h"
#include "base/values.h"
#include "chrome/browser/chromeos/input_method/inpu... |
5239dfa0-5d6a-4bc4-ba93-9e6f7ed6598a | {
"language": "C++"
} | ```c++
#include <cstdint>
#include <Magick++/Blob.h>
#include <Magick++/Image.h>
#define FUZZ_ENCODER_STRING_LITERAL(name) #name
#define FUZZ_ENCODER FUZZ_ENCODER_STRING_LITERAL(FUZZ_IMAGEMAGICK_ENCODER)
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
const Magick::Blob blob(Data, Size);
... | ```c++
#include <cstdint>
#include <Magick++/Blob.h>
#include <Magick++/Image.h>
#define FUZZ_ENCODER_STRING_LITERAL(name) #name
#define FUZZ_ENCODER FUZZ_ENCODER_STRING_LITERAL(FUZZ_IMAGEMAGICK_ENCODER)
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
const Magick::Blob blob(Data, Size);
... |
8ec27084-3ff8-4309-a09e-ff4883586092 | {
"language": "C++"
} | ```c++
#include <iostream>
#include <string>
#include <maproute/ip.hpp>
#include <maproute/ip_convertor.hpp>
#include <maproute/stringhelp.hpp>
#include <maproute/tr_parser.hpp>
#include <maproute/ip_location_finder.hpp>
int main() {
IPLocationFinder finder{};
while (std::cin.good()) {
std::string li... | ```c++
#include <iostream>
#include <string>
#include <maproute/ip.hpp>
#include <maproute/ip_convertor.hpp>
#include <maproute/stringhelp.hpp>
#include <maproute/tr_parser.hpp>
#include <maproute/ip_location_finder.hpp>
int main() {
while (std::cin.good()) {
std::string line;
std::string ip_strin... |
4cff895a-8e0d-4b95-b864-b390eace7866 | {
"language": "C++"
} | ```c++
#include "material.hpp"
Material::Material():
name{},
ka{0,0,0},
kd{0,0,0},
ks{0,0,0},
m{0}
{}
Material::Material(std::string const& name, Color const& ka, Color const& kd,
Color const& ks, float m):
name{name},
ka{ka},
kd{... | ```c++
#include "material.hpp"
Material::Material():
name{},
ka{0,0,0},
kd{0,0,0},
ks{0,0,0},
m{0}
{}
Material::Material(std::string const& name, Color const& ka, Color const& kd,
Color const& ks, float m):
name{name},
ka{ka},
kd{... |
b10659ba-ae32-4383-adda-8bcdee11a29d | {
"language": "C++"
} | ```c++
#include "perf_precomp.hpp"
using namespace std;
using namespace cv;
using namespace perf;
using std::tr1::make_tuple;
using std::tr1::get;
#define MAT_TYPES_DFT CV_32FC1, CV_64FC1
#define MAT_SIZES_DFT sz1080p, sz2K
#define TEST_MATS_DFT testing::Combine(testing::Values(MAT_SIZES_DFT), testing::Values(MAT_... | ```c++
#include "perf_precomp.hpp"
using namespace std;
using namespace cv;
using namespace perf;
using std::tr1::make_tuple;
using std::tr1::get;
#define MAT_TYPES_DFT CV_32FC1, CV_64FC1
#define MAT_SIZES_DFT sz1080p, sz2K
#define TEST_MATS_DFT testing::Combine(testing::Values(MAT_SIZES_DFT), testing::Values(MAT_... |
abcbcd86-075e-4de5-a0c0-c171f451328b | {
"language": "C++"
} | ```c++
#include "test/catch.hpp"
#include <string>
#include <vector>
#include "main/exception/FileOpenException.hpp"
#include "main/exception/InvalidArgumentException.hpp"
#include "main/MainApp.hpp"
TEST_CASE("MainApp class") {
using std::string;
using std::vector;
using pyconv::exception::FileOpenExcep... | ```c++
#include "test/catch.hpp"
#include <string>
#include <vector>
#include "main/exception/FileOpenException.hpp"
#include "main/exception/InvalidArgumentException.hpp"
#include "main/MainApp.hpp"
TEST_CASE("MainApp class") {
using std::string;
using std::vector;
using pyconv::exception::FileOpenExcep... |
ed420285-9bc2-4dcb-a5b4-eb8931781f11 | {
"language": "C++"
} | ```c++
/* -*- mode:linux -*- */
/**
* \file timeout.cc
*
*
*
* \author Ethan Burns
* \date 2008-12-16
*/
#include <iostream>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
using namespace std;
void alarm_action(int sig)
{
cout << "No Solution" << endl
<< "cost: infinity" << endl
<< ... | ```c++
/* -*- mode:linux -*- */
/**
* \file timeout.cc
*
*
*
* \author Ethan Burns
* \date 2008-12-16
*/
#include <iostream>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
using namespace std;
void alarm_action(int sig)
{
cout << "No Solution" << endl
<< "cost: infinity" << endl
<< ... |
0f9ff255-e21d-4144-8cfe-e0afcd99900e | {
"language": "C++"
} | ```c++
/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkNullCanvas.h"
#include "SkCanvas.h"
#include "SKNWayCanvas.h"
SkCanvas* SkCreateNullCanvas() {
// An N-Way canvas forwards calls to N canvas's. When ... | ```c++
/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkNullCanvas.h"
#include "SkCanvas.h"
#include "SKNWayCanvas.h"
SkCanvas* SkCreateNullCanvas() {
// An N-Way canvas forwards calls to N canvas's. When ... |
6fd243ea-9a61-46af-9681-9b6180d1a9d6 | {
"language": "C++"
} | ```c++
#include "performance_model.h"
#include "log.h"
using std::endl;
SimplePerformanceModel::SimplePerformanceModel()
: m_instruction_count(0)
, m_cycle_count(0)
{
}
SimplePerformanceModel::~SimplePerformanceModel()
{
}
void SimplePerformanceModel::outputSummary(std::ostream &os)
{
os << " Instructio... | ```c++
#include "performance_model.h"
#include "log.h"
using std::endl;
SimplePerformanceModel::SimplePerformanceModel()
: m_instruction_count(0)
, m_cycle_count(0)
{
}
SimplePerformanceModel::~SimplePerformanceModel()
{
}
void SimplePerformanceModel::outputSummary(std::ostream &os)
{
os << " Instructio... |
7da4a967-3444-4e9f-bfaa-8f40704bbd79 | {
"language": "C++"
} | ```c++
/*
Copyright 2007 Albert Strasheim <fullung@gmail.com>
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 applicab... | ```c++
/*
Copyright 2007 Albert Strasheim <fullung@gmail.com>
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 applicab... |
d830b163-d867-4405-911d-909ce18b51ff | {
"language": "C++"
} | ```c++
#include "scene.h"
#include "geometry/differential_geometry.h"
#include "lights/occlusion_tester.h"
void OcclusionTester::set_points(const Point &a, const Point &b){
float dist = a.distance(b);
ray = Ray{a, (b - a) / dist, 1e-6f, dist * (1.f - 1e-6f)};
}
void OcclusionTester::set_ray(const Point &p, const Vec... | ```c++
#include "scene.h"
#include "geometry/differential_geometry.h"
#include "lights/occlusion_tester.h"
void OcclusionTester::set_points(const Point &a, const Point &b){
ray = Ray{a, b - a, 1e-4f, 1};
}
void OcclusionTester::set_ray(const Point &p, const Vector &d){
ray = Ray{p, d.normalized(), 1e-4f};
}
bool Occ... |
55ec85ef-4bfa-452b-9706-7717e4c28d25 | {
"language": "C++"
} | ```c++
/*
* Copyright 2014 Cloudius Systems
*/
#include "database.hh"
#include "core/app-template.hh"
#include "core/smp.hh"
#include "thrift/server.hh"
namespace bpo = boost::program_options;
int main(int ac, char** av) {
app_template app;
app.add_options()
("thrift-port", bpo::value<uint16_t>()-... | ```c++
/*
* Copyright 2014 Cloudius Systems
*/
#include "database.hh"
#include "core/app-template.hh"
#include "core/smp.hh"
#include "thrift/server.hh"
namespace bpo = boost::program_options;
int main(int ac, char** av) {
app_template app;
app.add_options()
("thrift-port", bpo::value<uint16_t>()-... |
4221a090-0478-4558-b8b8-c57695832754 | {
"language": "C++"
} | ```c++
// RUN: rm -rf %t
// RUN: mkdir -p %t/prebuilt_modules
//
// RUN: %clang_cc1 -triple %itanium_abi_triple \
// RUN: -fmodules-ts -fprebuilt-module-path=%t/prebuilt-modules \
// RUN: -emit-module-interface -pthread -DBUILD_MODULE \
// RUN: %s -o %t/prebuilt_mod... | ```c++
// RUN: rm -rf %t
// RUN: mkdir -p %t/prebuilt_modules
//
// RUN: %clang_cc1 -triple %itanium_abi_triple \
// RUN: -fmodules-ts -fprebuilt-module-path=%t/prebuilt-modules \
// RUN: -emit-module-interface -pthread -DBUILD_MODULE \
// RUN: %s -o %t/prebuilt_mod... |
d1d3ee53-818e-4183-a6fc-0286b22347cb | {
"language": "C++"
} | ```c++
// RUN: %clang -### -Wlarge-by-value-copy %s 2>&1 | FileCheck -check-prefix=LARGE_VALUE_COPY_DEFAULT %s
// LARGE_VALUE_COPY_DEFAULT: -Wlarge-by-value-copy=64
// RUN: %clang -### -Wlarge-by-value-copy=128 %s 2>&1 | FileCheck -check-prefix=LARGE_VALUE_COPY_JOINED %s
// LARGE_VALUE_COPY_JOINED: -Wlarge-by-value-cop... | ```c++
// RUN: %clang -### -Wlarge-by-value-copy %s 2>&1 | FileCheck -check-prefix=LARGE_VALUE_COPY_DEFAULT %s
// LARGE_VALUE_COPY_DEFAULT: -Wlarge-by-value-copy=64
// RUN: %clang -### -Wlarge-by-value-copy=128 %s 2>&1 | FileCheck -check-prefix=LARGE_VALUE_COPY_JOINED %s
// LARGE_VALUE_COPY_JOINED: -Wlarge-by-value-cop... |
4ed5d2d4-5a91-42f2-936b-7b2ada6ffb96 | {
"language": "C++"
} | ```c++
/*
* Darwin SecRandomCopyBytes EntropySource
* (C) 2015 Daniel Seither (Kullo GmbH)
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
#include <botan/internal/darwin_secrandom.h>
#include <Security/Security.h>
namespace Botan {
/**
* Gather entropy from SecRandomCopyBytes
*/
void Dar... | ```c++
/*
* Darwin SecRandomCopyBytes EntropySource
* (C) 2015 Daniel Seither (Kullo GmbH)
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
#include <botan/internal/darwin_secrandom.h>
#include <Security/Security.h>
#include <Security/SecRandom.h>
namespace Botan {
/**
* Gather entropy fro... |
f0bed7a0-1879-40ea-b143-06b051205d00 | {
"language": "C++"
} | ```c++
#include "common.th"
_start:
bare_metal_init()
prologue
top:
d <- [rel(min0)]
e <- [rel(min1)]
f <- [rel(sec0)]
g <- [rel(sec1)]
h <- d << 4 + e
h <- h << 4 + f
h <- h << 4 + g
h -> [0x100]
c <- 1
call(sleep)
g <- g + 1
h <- g == 10
g <- g &~ h
... | ```c++
#include "common.th"
_start:
bare_metal_init()
prologue
top:
d <- [rel(min0)]
e <- [rel(min1)]
f <- [rel(sec0)]
g <- [rel(sec1)]
h <- d << 4 + e
h <- h << 4 + f
h <- h << 4 + g
h -> [0x100]
c <- 1
call(sleep)
g <- g + 1
h <- g == 10
g <- g &~ h
... |
8cd5b612-70f1-43cb-99fc-3d698e6334ac | {
"language": "C++"
} | ```c++
#include "MainWindow.h"
#include "SpritePackerProjectFile.h"
#include <QApplication>
int commandLine(QCoreApplication& app);
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
#ifdef Q_OS_WIN32
QApplication::setStyle(QStyleFactory::create("Fusion"));
#endif
QCoreApplication::setO... | ```c++
#include "MainWindow.h"
#include "SpritePackerProjectFile.h"
#include <QApplication>
int commandLine(QCoreApplication& app);
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QCoreApplication::setOrganizationName("amakaseev");
QCoreApplication::setOrganizationDomain("spicyminds-lab.... |
558c0d52-0243-4ac1-9a14-1b323b0c2d32 | {
"language": "C++"
} | ```c++
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
#include <quic/common/BufAccessor.h>
#include <folly/portability/GTest.h>
namespace quic {
TEST(SimpleBufAccessor, Basic... | ```c++
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
#include <quic/common/BufAccessor.h>
#include <folly/portability/GTest.h>
namespace quic {
TEST(SimpleBufAccessor, Basic... |
c869dc22-3ea3-4424-9872-88e5952e2a0f | {
"language": "C++"
} | ```c++
#include <QtGui>
#include <sequanto/automation.h>
#include <sequanto/tree.h>
#include <sequanto/QtWrapper.h>
#include "../cxx/src/cxx_root.h"
#include <windows.h>
using namespace sequanto::automation;
int main ( int argc, char * argv[] )
{
SQServer server;
sq_init ();
sq_serve... | ```c++
#include <QtGui>
#include <sequanto/automation.h>
#include <sequanto/tree.h>
#include <sequanto/QtWrapper.h>
#include "../cxx/src/cxx_root.h"
#include "config.h"
using namespace sequanto::automation;
int main ( int argc, char * argv[] )
{
SQServer server;
sq_init ();
sq_server_i... |
e16e86c9-426e-471c-9cda-26c69c8c247e | {
"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 "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
IN_PROC_BR... | ```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 "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
// Flaky, h... |
1c4308fe-59ff-4f7a-ae45-ab7e2edb87b2 | {
"language": "C++"
} | ```c++
#include "insect/records.h"
static void
__record(Record *);
#include <assert.h>
#include <stdlib.h>
#include <string.h>
static void
__path_copy(RecordPath path, RecordPath *ref)
{
int len = strnlen(path, RECORD_PATH_MAX);
assert(ref);
*ref = malloc(len + 1);
assert(*ref);
(void) strncpy(*ref, path, len ... | ```c++
#include "insect/records.h"
static void
__record(Record *);
static void
__path_copy(Path, Path *);
/* FIMXE(teh): ^ inline? */
#include <assert.h>
#include <stdlib.h>
Record *
record_new(Path path)
{
Record *record;
assert(path);
record = malloc(sizeof(Record));
assert(record);
record->hits = 1;
recor... |
f7417e05-b271-48da-b3fa-a0ba385699a2 | {
"language": "C++"
} | ```c++
#include <functional>
#include <boost/optional.hpp>
#include "key_aliases.hh"
#include "file_contents.hh"
#include "contents.hh"
#include "mode.hh"
#include "show_message.hh"
std::map < char, std::function < void (contents&, boost::optional<int>) > >
global_normal_map,
global_insert_map;
mode::mode(co... | ```c++
#include <functional>
#include <boost/optional.hpp>
#include "key_aliases.hh"
#include "file_contents.hh"
#include "contents.hh"
#include "mode.hh"
#include "show_message.hh"
std::map < char, std::function < void (contents&, boost::optional<int>) > >
global_normal_map,
global_insert_map;
mode::mode(co... |
3ca5cc28-fe9b-497c-b063-31748d7ede3b | {
"language": "C++"
} | ```c++
#include <mlopen/hipoc_kernel.hpp>
#include <mlopen/errors.hpp>
namespace mlopen {
void HIPOCKernelInvoke::run(void* args, std::size_t size) const
{
hipEvent_t start = nullptr;
hipEvent_t stop = nullptr;
void *config[] = {
HIP_LAUNCH_PARAM_BUFFER_POINTER, args,
HIP_LAUNCH_PARAM_BUF... | ```c++
#include <mlopen/hipoc_kernel.hpp>
#include <mlopen/errors.hpp>
namespace mlopen {
void HIPOCKernelInvoke::run(void* args, std::size_t size) const
{
hipEvent_t start = nullptr;
hipEvent_t stop = nullptr;
void *config[] = {
HIP_LAUNCH_PARAM_BUFFER_POINTER, args,
HIP_LAUNCH_PARAM_BUF... |
1c1196de-dd08-46a9-886e-1a68ccfaa04e | {
"language": "C++"
} | ```c++
//
// Created by dar on 2/11/16.
//
#include <gui/GuiText.h>
#include "TextManager.h"
TextManager::TextManager() : GuiElementRender() {
this->charRender = new CharRender();
}
TextManager::~TextManager() {
delete this->charRender;
}
void TextManager::render(const GuiElement *const element, glm::mat4 p... | ```c++
//
// Created by dar on 2/11/16.
//
#include <gui/GuiText.h>
#include "TextManager.h"
TextManager::TextManager() : GuiElementRender() {
this->charRender = new CharRender();
}
TextManager::~TextManager() {
delete this->charRender;
}
void TextManager::render(const GuiElement *const element, glm::mat4 p... |
04efe42e-5985-4dd1-9319-a38fcb7ab5ae | {
"language": "C++"
} | ```c++
#ifdef CHIPKIT
#include "serialutil.h"
#include "buffers.h"
#include "log.h"
void readFromSerial(SerialDevice* serial, bool (*callback)(uint8_t*)) {
int bytesAvailable = serial->device->available();
if(bytesAvailable > 0) {
for(int i = 0; i < bytesAvailable && !queue_full(&serial->receiveQueue)... | ```c++
#ifdef CHIPKIT
#include "serialutil.h"
#include "buffers.h"
#include "log.h"
void readFromSerial(SerialDevice* serial, bool (*callback)(uint8_t*)) {
int bytesAvailable = serial->device->available();
if(bytesAvailable > 0) {
for(int i = 0; i < bytesAvailable && !queue_full(&serial->receiveQueue)... |
091d5b18-b3f0-4e0f-9405-927d5848dd0b | {
"language": "C++"
} | ```c++
// test/SemaCXX/coroutine-traits-undefined-template.cpp
// This file contains references to sections of the Coroutines TS, which can be
// found at http://wg21.link/coroutines.
// RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -verify %s -fcxx-exceptions -fexceptions -Wunused-result
namespace std {
namespace expe... | ```c++
// This file contains references to sections of the Coroutines TS, which can be
// found at http://wg21.link/coroutines.
// RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -verify %s -fcxx-exceptions -fexceptions -Wunused-result
namespace std {
namespace experimental {
template<typename ...T>
struct coroutine_trai... |
ccfed351-361f-4210-a898-c3db8dd678d7 | {
"language": "C++"
} | ```c++
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qbs.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may... | ```c++
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qbs.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may... |
296b3922-9fcc-46c7-994b-159a4a8709b5 | {
"language": "C++"
} | ```c++
///////////////////////////////////////
/// file: linklist_test.cpp
///////////////////////////////////////
#include <iostream>
#include "linklist.h"
using namespace std;
///
/// 打印链表
///
template<typename T>
void PrintList(LinkList<T> L)
{
cout << "(";
auto p = L->next;
while(p) {
cout << ... | ```c++
///////////////////////////////////////
/// file: linklist_test2.cpp
///////////////////////////////////////
#include <iostream>
#include "linklist.h"
using namespace std;
///
/// 打印链表
///
template<typename T>
void PrintList(LinkList<T> L)
{
cout << "(";
auto p = L->next;
while(p) {
cout <<... |
b28d0b6e-b1d6-4864-b9f8-d2873b1b8285 | {
"language": "C++"
} | ```c++
#include "viewer/details-window.h"
#include <QLabel>
#include <ui_details-window.h>
#include "helpers.h"
#include "models/image.h"
DetailsWindow::DetailsWindow(Profile *profile, QWidget *parent)
: QDialog(parent), ui(new Ui::DetailsWindow), m_profile(profile)
{
ui->setupUi(this);
}
DetailsWindow::~DetailsWi... | ```c++
#include "viewer/details-window.h"
#include <QLabel>
#include <ui_details-window.h>
#include "helpers.h"
#include "models/image.h"
DetailsWindow::DetailsWindow(Profile *profile, QWidget *parent)
: QDialog(parent), ui(new Ui::DetailsWindow), m_profile(profile)
{
ui->setupUi(this);
}
DetailsWindow::~DetailsWi... |
f175d3fb-8d96-4291-9c6f-11f0dce15953 | {
"language": "C++"
} | ```c++
#include <vector>
#include <string>
std::string createString(){
std::string hi("Hello world!");
return hi;
}
std::vector<std::string> createVector(){
std::vector<std::string> my_vector;
my_vector.push_back(createString());
my_vector.push_back(createString());
my_vector.push_back(createString());
return ... | ```c++
#include <vector>
#include <string>
std::string createString(){
std::string hi("Hello world!");
return hi;
}
std::vector<std::string> createVector(){
std::vector<std::string> my_vector;
my_vector.push_back(createString());
my_vector.push_back(createString());
my_vector.push_back(createString());
return ... |
1b98d902-e258-488c-b21a-ae1946a208e5 | {
"language": "C++"
} | ```c++
// request symbols
#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/CValuePrinter.h"
#include "cling/Interpreter/DynamicExprInfo.h"
#include "cling/Interpreter/InterpreterCallbacks.h"
#include "cling/Interpreter/LookupHelper.h"
#include "cling/Interpreter/ValuePrinter.h"
#include "cling/Int... | ```c++
// request symbols
#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/CValuePrinter.h"
#include "cling/Interpreter/DynamicExprInfo.h"
#include "cling/Interpreter/InterpreterCallbacks.h"
#include "cling/Interpreter/LookupHelper.h"
#include "cling/Interpreter/ValuePrinter.h"
#include "cling/Int... |
49265cdd-b287-45bd-86df-253e401240ab | {
"language": "C++"
} | ```c++
#ifdef __LPC17XX__
#include "canread.h"
CanMessage receiveCanMessage(CanBus* bus) {
CAN_MSG_Type message;
CAN_ReceiveMsg(bus->controller, &message);
CanMessage result = {message.id, 0};
result.data = message.dataA[0];
result.data |= (message.dataA[1] << 8);
result.data |= (message.data... | ```c++
#ifdef __LPC17XX__
#include "canread.h"
#include "signals.h"
extern "C" {
void CAN_IRQHandler() {
if((CAN_IntGetStatus(LPC_CAN1) & 0x01) == 1) {
getCanBuses()[0].messageReceived = true;
} else if((CAN_IntGetStatus(LPC_CAN2) & 0x01) == 1) {
getCanBuses()[1].messageReceived = true;
}... |
05f78011-8d59-4371-84e5-716bd03b457a | {
"language": "C++"
} | ```c++
#include <iostream>
#include <array>
#include <asio/steady_timer.hpp>
#include <asio.hpp>
#include <thread>
#include "node/raft_node.h"
using namespace std;
std::vector<raft_node_endpoint_t> peers{
{1ul, "localhost", 12345, 13001},
{2ul, "localhost", 12346, 13002},
{3ul, "localhost", 12... | ```c++
#include <iostream>
#include <array>
#include <asio/steady_timer.hpp>
#include <asio.hpp>
#include <thread>
#include "node/raft_node.h"
using namespace std;
std::vector<raft_node_endpoint_t> peers{
{1ul, "localhost", 12345, 13001},
{2ul, "localhost", 12346, 13002},
{3ul, "localhost", 12... |
f9b98bff-3f3d-4a47-b036-6eb26847a1e2 | {
"language": "C++"
} | ```c++
#include "planning/jet/filter_sim.hh"
#include "eigen_helpers.hh"
namespace planning {
namespace jet {
estimation::jet_filter::State kf_state_from_xlqr_state(const State& x,
const Controls& u,
const P... | ```c++
#include "planning/jet/filter_sim.hh"
#include "eigen_helpers.hh"
namespace planning {
namespace jet {
estimation::jet_filter::State kf_state_from_xlqr_state(const State& x,
const Controls& u,
const P... |
1457139d-56eb-45fe-bbc1-847ee61ebfab | {
"language": "C++"
} | ```c++
#include "RobotState.h"
RobotStateInterface* RobotState::impl = 0;
void RobotState::SetImplementation(RobotStateInterface* i) {
impl = i;
}
bool RobotState::IsDisabled() {
if (impl != 0) {
return impl->IsDisabled();
}
return true;
}
bool RobotState::IsEnabled() {
if (impl != 0) {
... | ```c++
#include "RobotState.h"
RobotStateInterface* RobotState::impl = 0;
void RobotState::SetImplementation(RobotStateInterface* i) {
impl = i;
}
bool RobotState::IsDisabled() {
if (impl != 0) {
return impl->IsDisabled();
}
return true;
}
bool RobotState::IsEnabled() {
if (impl != 0) {
... |
6ef0db45-8258-482e-b1f6-f3fbfea0e9c0 | {
"language": "C++"
} | ```c++
// Copyright (c) 2008-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/history/history_publisher.h"
#include "base/utf_string_conversions.h"
namespace history {
const char* const Hi... | ```c++
// Copyright (c) 2008-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/history/history_publisher.h"
#include "base/utf_string_conversions.h"
namespace history {
const char* const Hi... |
967cf0b0-e53e-423a-bb07-174abf175b3e | {
"language": "C++"
} | ```c++
// Validate multiple reads
#include <sstream>
#include <string>
int main()
{
std::istringstream stream{"John Smith 32"};
std::string first_name;
std::string family_name;
int age;
if (stream >> first_name &&
stream >> family_name &&
stream >> age) {
// Use values
}
}
// Validate reading mul... | ```c++
// Validate multiple reads
#include <sstream>
#include <string>
int main()
{
std::istringstream stream{"John Smith 32"};
std::string first_name;
std::string family_name;
int age;
if (stream >> first_name &&
stream >> family_name &&
stream >> age) {
// Use values
}
}
// Ensure that multiple... |
6529ef8e-18f7-465e-beb1-861fb2de93f9 | {
"language": "C++"
} | ```c++
#include <gtest/gtest.h>
#include "../c_oriented.h"
#include "../c_moveable.h"
using aronnax::Vector2d;
using spacegun::Moveable;
using spacegun::Oriented;
class OrientedTest : public testing::Test {
protected:
virtual void SetUp() {
expectedAngle_ = 15.0;
moveable_ = new Moveable(Vector2d... | ```c++
#include <gtest/gtest.h>
#include "../c_oriented.h"
#include "../c_moveable.h"
using aronnax::Vector2d;
using spacegun::Moveable;
using spacegun::Oriented;
class OrientedTest : public testing::Test {
protected:
virtual void SetUp() {
expectedAngle_ = 15.0;
moveable_ = new Moveable(Vector2d... |
d52a30e4-28e5-431d-b618-8aa73b7d8794 | {
"language": "C++"
} | ```c++
/******************************************************
* This is CIR-KIT 3rd robot control driver.
* Author : Arita Yuta(Kyutech)
******************************************************/
#include "cirkit_unit03_driver.hpp"
#include <string>
#include <utility>
int main(int argc, char** argv)
{
ros::init(ar... | ```c++
/******************************************************
* This is CIR-KIT 3rd robot control driver.
* Author : Arita Yuta(Kyutech)
******************************************************/
#include "cirkit_unit03_driver.hpp"
#include <string>
#include <utility>
int main(int argc, char** argv)
{
ros::init(ar... |
33066a10-04ed-41eb-848f-14ccddf2218d | {
"language": "C++"
} | ```c++
#include "Progression.h"
Progression* Progression::m_instance = nullptr;
Progression::Progression()
{
this->m_currentLevel = 0;
this->m_currentCheckpoint = 0;
this->m_unlockedLevels = 0;
}
Progression::~Progression()
{
}
bool Progression::WriteToFile(std::string filename)
{
std::ofstream saveFile;
sav... | ```c++
#include "Progression.h"
Progression* Progression::m_instance = nullptr;
Progression::Progression()
{
this->m_currentLevel = 0;
this->m_currentCheckpoint = 0;
this->m_unlockedLevels = 0;
}
Progression::~Progression()
{
}
bool Progression::WriteToFile(std::string filename)
{
std::ofstream saveFile;
sav... |
fa4f9e7a-39f5-472f-8d49-3a2af61592c3 | {
"language": "C++"
} | ```c++
#include <iostream>
#include "list.h"
int List::numberOfNodes = 0;
void List::addToHead(int value) {
node *temp=new node;
temp->data=value;
temp->next=head;
head=temp;
numberOfNodes++;
}
void List::addToTail(int value) {
node *temp = new node;
temp->data = value;
temp->next = NULL;
if(hea... | ```c++
#include <iostream>
#include "list.h"
int List::numberOfNodes = 0;
void List::addToHead(int value) {
node *temp=new node;
temp->data=value;
temp->next=head;
head=temp;
numberOfNodes++;
}
void List::addToTail(int value) {
node *temp = new node;
temp->data = value;
temp->next = NULL;
if(head =... |
b694ad0a-be89-425b-b73b-de48928b0295 | {
"language": "C++"
} | ```c++
#include <Ab/Config.hpp>
#include <Ab/Memory.hpp>
namespace Ab {
const MemoryConfig Memory::defaultConfig_;
} // namespace Ab
```
Add constexpr keyword to inline inited variable | ```c++
#include <Ab/Config.hpp>
#include <Ab/Memory.hpp>
namespace Ab {
constexpr const MemoryConfig Memory::defaultConfig_;
} // namespace Ab
``` |
63fd58df-c2e8-4f69-b4ec-0977854c5fdf | {
"language": "C++"
} | ```c++
#include <Halide.h>
#include <stdio.h>
#include <stdlib.h>
using namespace Halide;
int main() {
// This test must be run with an OpenGL target
const Target &target = get_jit_target_from_environment();
if (!target.has_feature(Target::OpenGL)) {
fprintf(stderr,"ERROR: This test must be run w... | ```c++
#include <Halide.h>
#include <stdio.h>
#include <stdlib.h>
using namespace Halide;
int main() {
// This test must be run with an OpenGL target
const Target &target = get_jit_target_from_environment();
if (!target.has_feature(Target::OpenGL)) {
fprintf(stderr,"ERROR: This test must be run w... |
12709d73-b081-48e4-a7f5-421bacf89213 | {
"language": "C++"
} | ```c++
/**
* @file
*
* The driver program.
*/
#include "bi/build/Driver.hpp"
#include "bi/exception/DriverException.hpp"
#include "bi/build/misc.hpp"
#include <iostream>
int main(int argc, char** argv) {
using namespace bi;
try {
/* first option (should be a program name) */
std::string prog;
if (... | ```c++
/**
* @file
*
* The driver program.
*/
#include "bi/build/Driver.hpp"
#include "bi/exception/DriverException.hpp"
#include "bi/build/misc.hpp"
#include <iostream>
int main(int argc, char** argv) {
using namespace bi;
try {
/* first option (should be a program name) */
std::string prog;
if (... |
c265180b-ad74-4f80-85b5-0ed070960830 | {
"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.
// This is a simple allocator based on the windows heap.
extern "C" {
HANDLE win_heap;
bool win_heap_init(bool use_lfh) {
win_heap = HeapC... | ```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.
// This is a simple allocator based on the windows heap.
extern "C" {
HANDLE win_heap;
bool win_heap_init(bool use_lfh) {
win_heap = HeapC... |
e3067d6c-e8f9-4ee5-9282-b8e0d964e59d | {
"language": "C++"
} | ```c++
#include "Moves/Queenside_Castle.h"
#include "Moves/Move.h"
#include "Game/Board.h"
#include "Pieces/Piece.h"
Queenside_Castle::Queenside_Castle() : Move(-2, 0)
{
}
bool Queenside_Castle::move_specific_legal(const Board& board, char file_start, int rank_start) const
{
return ! board.piece_has_moved(fi... | ```c++
#include "Moves/Queenside_Castle.h"
#include "Moves/Move.h"
#include "Game/Board.h"
#include "Pieces/Piece.h"
Queenside_Castle::Queenside_Castle() : Move(-2, 0)
{
}
bool Queenside_Castle::move_specific_legal(const Board& board, char file_start, int rank_start) const
{
return ! board.piece_has_moved(fi... |
71b4b8b5-79a9-4038-8d5a-4408bc788ae9 | {
"language": "C++"
} | ```c++
/*
@ 0xCCCCCCCC
*/
int main()
{
return 0;
}```
Add quick test for logging worker. | ```c++
/*
@ 0xCCCCCCCC
*/
#include <conio.h>
#include <random>
#include <sstream>
#include "klog/klog_worker.h"
void WorkerTest()
{
klog::LogWorker worker(std::wstring(L"test.log"), std::chrono::seconds(3));
std::random_device rd;
std::default_random_engine engine(rd());
std::uniform_int_distributi... |
017bc125-2c10-4624-9d00-8e9091c5e1cb | {
"language": "C++"
} | ```c++
#include "./ShapeSphere.hpp"
#include "math/misc.hpp"
#include "math/Sphere.hpp"
#include <cmath>
using namespace yks;
Optional<float> ShapeSphere::hasIntersection(const Ray& r) const {
const Ray local_ray = transform.localFromParent * r;
return intersect_with_sphere(vec3_0, 1.0f, local_ray);
}
Optional<Int... | ```c++
#include "./ShapeSphere.hpp"
#include "math/misc.hpp"
#include "math/Sphere.hpp"
#include <cmath>
using namespace yks;
Optional<float> ShapeSphere::hasIntersection(const Ray& r) const {
const Ray local_ray = transform.localFromParent * r;
return intersect_with_sphere(vec3_0, 1.0f, local_ray);
}
Optional<Int... |
6b383f06-a89f-40e5-8960-f5e006ebd6fe | {
"language": "C++"
} | ```c++
#include <stdexcept>
#include "gtest/gtest.h"
#include "map/Level.h"
#include "map/Tile.h"
TEST(LevelTest, DefaultLevelIsWalls)
{
Level l1(10, 10);
EXPECT_EQ(WallTile, l1.getTile(5, 5));
}
TEST(LevelTest, LevelGetTile)
{
Level l1(10, 10);
EXPECT_NO_THROW(l1.getTile(5, 5));
EXPECT_THROW(l1.getTile(50, 5... | ```c++
#include <stdexcept>
#include "gtest/gtest.h"
#include "map/Level.h"
#include "map/Tile.h"
TEST(LevelTest, DefaultLevelIsWalls)
{
Level l1(10, 10);
EXPECT_EQ(WallTile, l1.getTile(5, 5));
}
TEST(LevelTest, LevelGetTile)
{
Level l1(10, 10);
EXPECT_NO_THROW(l1.getTile(9, 9));
EXPECT_THROW(l1.getTile(10, 1... |
61f67366-5ef3-4015-aadb-dc09a9f631cd | {
"language": "C++"
} | ```c++
// RUN: %clangxx_asan -coverage -O0 %s -o %t
// RUN: %env_asan_opts=check_initialization_order=1 %run %t 2>&1 | FileCheck %s
// XFAIL: android
#include <stdio.h>
int foo() { return 1; }
int XXX = foo();
int main() {
printf("PASS\n");
// CHECK: PASS
}
```
Disable test that uses profile runtime on Windows. | ```c++
// RUN: %clangxx_asan -coverage -O0 %s -o %t
// RUN: %env_asan_opts=check_initialization_order=1 %run %t 2>&1 | FileCheck %s
// XFAIL: android
// We don't really support running tests using profile runtime on Windows.
// UNSUPPORTED: win32
#include <stdio.h>
int foo() { return 1; }
int XXX = foo();
int main() {
... |
e6bd9f23-f7b6-4649-a57d-634f30ec6515 | {
"language": "C++"
} | ```c++
//
// Copyright (c) 2014 The ANGLE Project 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 "libEGL/AttributeMap.h"
namespace egl
{
AttributeMap::AttributeMap()
{
}
AttributeMap::AttributeMap(const EGLint *attrib... | ```c++
//
// Copyright (c) 2014 The ANGLE Project 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 "libEGL/AttributeMap.h"
namespace egl
{
AttributeMap::AttributeMap()
{
}
AttributeMap::AttributeMap(const EGLint *attrib... |
4d003f11-af92-4170-a4f3-9b60140c1c63 | {
"language": "C++"
} | ```c++
// Copyright (c) 2012 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 "content/renderer/render_view_impl.h"
#include "base/command_line.h"
#include "base/message_loop.h"
#include "cc/trees/layer_tree_hos... | ```c++
// Copyright (c) 2012 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 "content/renderer/render_view_impl.h"
#include "base/command_line.h"
#include "base/message_loop.h"
#include "cc/trees/layer_tree_hos... |
49c569b7-24df-4465-be12-a115f039be2f | {
"language": "C++"
} | ```c++
#include "main.h"
#include <boost/program_options.hpp>
#include <iostream>
namespace po = boost::program_options;
using namespace std;
int main(int argc, char **argv)
{
po::options_description program_desc("Simplicity window manager");
program_desc.add_options()
("help", "Display usage")
;
po::variabl... | ```c++
#include "main.h"
#include <boost/program_options.hpp>
#include <iostream>
namespace po = boost::program_options;
using namespace std;
void print_version(void);
int main(int argc, char **argv)
{
po::options_description program_desc("Simplicity window manager");
program_desc.add_options()
("help", "Di... |
0e2c0cff-ef76-40bd-b811-aaa9b370e6c3 | {
"language": "C++"
} | ```c++
/**
* Assimp2XML3D
*
* Copyright (c)2015, Christian Schlinkmann
*
*
**/
#include <assimp/version.h>
#include <assimp/postprocess.h>
#include <assimp/scene.h>
#include <assimp/Importer.hpp>
#include <assimp/Exporter.hpp>
#include <iostream>
int invalidUsageExit() {
std::cout << "usage: assimp2xml3d [FLAGS] in... | ```c++
/**
* Assimp2XML3D
*
* Copyright (c)2015, Christian Schlinkmann
*
*
**/
#include <assimp/version.h>
#include <assimp/postprocess.h>
#include <assimp/scene.h>
#include <assimp/Importer.hpp>
#include <assimp/Exporter.hpp>
#include <iostream>
extern Assimp::Exporter::ExportFormatEntry Assimp2XML3D_desc;
int inv... |
9fbf4bff-4d0c-46d8-8f0b-da7515687672 | {
"language": "C++"
} | ```c++
#include <iostream>
#include <stdexcept>
#include <string>
#include "application.hpp"
#include <GL/glew.h>
void init_glew()
{
GLenum err = glewInit();
if (GLEW_OK != err)
{
throw std::runtime_error(reinterpret_cast<const char *>(glewGetErrorString(err)));
}
}
int main(int argc, char co... | ```c++
#include <iostream>
#include <stdexcept>
#include <string>
#include "application.hpp"
#include <GL/glew.h>
void init_sdl()
{
if (SDL_Init(SDL_INIT_EVERYTHING) != 0)
{
throw std::runtime_error(SDL_GetError());
}
}
void init_glew()
{
GLenum err = glewInit();
if (GLEW_OK != err)
{... |
78675ebf-0dcc-4922-a615-f6eb6c698f1c | {
"language": "C++"
} | ```c++
#include <cstdlib>
#include <iostream>
#include <boost/asio.hpp>
#include <boost/thread.hpp>
#include <proxylib/proxylib.h>
void signal_handler(int signal) {
fprintf(stderr, "Received signal %d\nExiting...\n", signal);
exit(0);
}
void install_sighandlers() {
signal(SIGHUP, SIG_IGN);
signal(SIGINT, signal_h... | ```c++
#include <cstdlib>
#include <iostream>
#include <boost/asio.hpp>
#include <boost/thread.hpp>
#include <proxylib/proxylib.h>
void signal_handler(int signal) {
std::cerr << "Received signal " << signal << "\nExiting..." << std::endl;
exit(0);
}
void install_sighandlers() {
signal(SIGHUP, SIG_IGN);
signal(SI... |
c3922a6a-c1bf-4cc5-8536-5cdeccf18ebc | {
"language": "C++"
} | ```c++
#include "crash_reporting.h"
#include "infrastructure/breakpad.h"
#include <fmt/format.h>
#include "platform/windows.h"
Breakpad::Breakpad(const std::wstring &crashDumpFolder, bool fullDump)
{
mHandler = std::make_unique<InProcessCrashReporting>(crashDumpFolder, fullDump, [this](const std::wstring... | ```c++
#include "crash_reporting.h"
#include "infrastructure/breakpad.h"
#include <fmt/format.h>
#include "platform/windows.h"
#include <infrastructure/stringutil.h>
#include <filesystem>
#include <Shlwapi.h>
namespace fs = std::filesystem;
Breakpad::Breakpad(const std::wstring &crashDumpFolder, bool fu... |
76a075b9-00f1-4fa4-ada0-5511f4c1b1d3 | {
"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_function.h"
#include "chrome/browser/extensions/extension_function_dispatcher.h"
void Extension... | ```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_function.h"
#include "chrome/browser/extensions/extension_function_dispatcher.h"
void Extension... |
7037d7db-bd30-401b-bd62-726b57c7d59a | {
"language": "C++"
} | ```c++
#include "Context.hpp"
Context* _global_ctx = nullptr;
namespace Backend {
void init_global_context() {
if (!_global_ctx)
_global_ctx = new Context;
// TODO: Add other device types (esp CUDA)
_global_ctx->device = SPIKE_DEVICE_DUMMY;
}
Context* get_current_context() {
return _globa... | ```c++
#include "Context.hpp"
Context* _global_ctx = nullptr;
namespace Backend {
void init_global_context() {
if (!_global_ctx)
_global_ctx = new Context;
// TODO: Add other device types (esp CUDA)
#ifdef SPIKE_WITH_CUDA
_global_ctx->device = SPIKE_DEVICE_CUDA;
#else
_global_ctx->device = SPI... |
9fd70078-75df-41ad-af81-c415a85c8e93 | {
"language": "C++"
} | ```c++
#include "JasonType.h"
using JasonType = triagens::basics::JasonType;
////////////////////////////////////////////////////////////////////////////////
/// @brief get the name for a Jason type
////////////////////////////////////////////////////////////////////////////////
char const* triagens::basics::Ja... | ```c++
#include "JasonType.h"
using JasonType = triagens::basics::JasonType;
////////////////////////////////////////////////////////////////////////////////
/// @brief get the name for a Jason type
////////////////////////////////////////////////////////////////////////////////
char const* triagens::basics::Ja... |
da42728e-f568-4727-b7de-35efd6588d08 | {
"language": "C++"
} | ```c++
#include "MiNodePIR.h"
MiNodePIR::MiNodePIR() :
pin(NULL)
{
this->baseId = MINODE_ID_MODULE_PIR;
}
MiNodePIR::~MiNodePIR()
{
if(pin) {
delete pin;
}
}
void MiNodePIR::attach(ConnName connName)
{
if(this->cn != MN_NC) {
return;
}
MiNodeComponent::initConnector(connName);
PinName pinName... | ```c++
#include "MiNodePIR.h"
MiNodePIR::MiNodePIR() :
pin(NULL)
{
this->baseId = MINODE_ID_MODULE_PIR;
}
MiNodePIR::~MiNodePIR()
{
if(pin) {
delete pin;
}
}
void MiNodePIR::attach(ConnName connName)
{
if(this->cn != MN_NC) {
return;
}
MiNodeComponent::initConnector(connName);
PinName pinName... |
3355bf24-5218-4ba1-86e0-4e695b64cb9f | {
"language": "C++"
} | ```c++
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: echo '[{"directory":".","command":"clang++ -c %t/test.cpp","file":"%t/test.cpp"}]' > %t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
// RUN: PWD="%t" clang-check "%t" "test.cpp" 2>&1|FileCheck %s
// FIXME: Make the above easier.
// CHECK: C++ requires
invalid;
... | ```c++
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -c %t/test.cpp\",\"file\":\"%t/test.cpp\"}]" > %t/compile_commands.json
// RUN: cp "%s" "%t/test.cpp"
// RUN: PWD="%t" clang-check "%t" "test.cpp" 2>&1|FileCheck %s
// FIXME: Make the above easier.
// CHECK: C++ require... |
5465cba7-cb48-4d88-a195-741d21f8ea28 | {
"language": "C++"
} | ```c++
// C++11 code with initializers.
//
// g++ -std=c++11 -pedantic -fsyntax-only cpp11.cpp
// clang++ -std=c++11 -pedantic -fsyntax-only cpp11.cpp
struct A {
int i = 0;
double j = 0.0;
};
int main() {
A a; // OK, a.i is 0 and a.j is 0.0
A b = {}; // OK, b.i is 0 and b.j is 0.0... | ```c++
// C++11 code with initializers.
//
// g++ -std=c++11 -pedantic -fsyntax-only cpp11.cpp
// clang++ -std=c++11 -pedantic -fsyntax-only cpp11.cpp
struct A {
int i = 0;
double j = 0.0;
};
int main() {
A a; // OK, a.i is 0 and a.j is 0.0
A b = {}; // OK, b.i is 0 and b.j is 0.0... |
b7f28d29-85aa-46c6-8363-ea3c63fd5e94 | {
"language": "C++"
} | ```c++
#include <QApplication>
#include <QDeclarativeView>
#include <QUrl>
int main(int argc, char** argv)
{
// FIXME: Use the (new?) harmattan booster!!
QApplication app(argc, argv);
QDeclarativeView viewer;
viewer.setSource(QUrl("qrc:/qml/main.qml"));
viewer.showFullScreen();
return app.exe... | ```c++
#include <QApplication>
#include <QDeclarativeView>
#include <QUrl>
#include <MDeclarativeCache>
Q_DECL_EXPORT int main(int argc, char** argv)
{
QApplication* app = MDeclarativeCache::qApplication(argc, argv);
QDeclarativeView viewer;
viewer.setSource(QUrl("qrc:/qml/main.qml"));
viewer.showFull... |
f8fcfee4-70eb-4df5-a264-cfb5fa7b9e9c | {
"language": "C++"
} | ```c++
// RUN: %clangxx -O0 %s -o %t && %run %t
// XFAIL: arm-linux-gnueabi
#include <assert.h>
#include <pthread.h>
int main(void) {
pthread_mutexattr_t ma;
int res = pthread_mutexattr_init(&ma);
assert(res == 0);
res = pthread_mutexattr_setpshared(&ma, 1);
assert(res == 0);
int pshared;
res = pthread_... | ```c++
// RUN: %clangxx -O0 %s -o %t && %run %t
#include <assert.h>
#include <pthread.h>
int main(void) {
pthread_mutexattr_t ma;
int res = pthread_mutexattr_init(&ma);
assert(res == 0);
res = pthread_mutexattr_setpshared(&ma, 1);
assert(res == 0);
int pshared;
res = pthread_mutexattr_getpshared(&ma, &p... |
672592cd-9b1c-40b2-8be2-04cb31599b71 | {
"language": "C++"
} | ```c++
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "Color.h"
namespace facebook {
namespace react {
SharedColor colorFromComponents(ColorComponents components) {
retur... | ```c++
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "Color.h"
namespace facebook {
namespace react {
SharedColor colorFromComponents(ColorComponents components) {
float... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.