Gang Of Coders
Home
About Us
Contact Us
All C++ Solutions on Gang of Coders
Total of 4847 C++ Solutions
Why is processing a sorted array faster than processing an unsorted array?
Java
C++
Performance
Cpu Architecture
Branch Prediction
The Definitive C++ Book Guide and List
C++
C++ Faq
How can I know which parts in the code are never used?
C++
Optimization
Dead Code
Use of string_view for map lookup
C++
Dictionary
C++14
String View
C++ function argument safety
C++
C++14
What is the rationale behind decltype behavior?
C++
C++11
C++14
Decltype
Type Deduction
What is the operator "" in C++?
C++
Operators
Language Design
How to get CMake to pass either std=c++14/c++1y or c++17/c++1z based on GCC version?
C++
Cmake
C++14
Gcc4
Using Boost.Lockfree queue is slower than using mutexes
C++
Multithreading
Performance
Boost
Lock Free
What is the C++ equivalent of Python's "in" operator?
C++
Arrays
Why isn't there an endianness modifier in C++ like there is for signedness?
C++
Endianness
Language Features
Static Typing
Numerically stable way to compute sqrt((b²*c²) / (1-c²)) for c in [-1, 1]
C++
Math
Floating Point
Numerical Stability
What is "destroying operator delete" in C++20?
C++
Destructor
C++20
Delete Operator
Destroy
How do I call ::CreateProcess in c++ to launch a Windows executable?
C++
Windows
Winapi
Capturing stdout from a system() command optimally
C++
C
System
Stdout
CRC32 C or C++ implementation
C++
C
Crc32
Faster bulk inserts in sqlite3?
C++
Sqlite
Insert
Bulk
Will new return NULL in any case?
C++
Visual C++
Memory Management
New Operator
Visual C++-6
NULL pointer with boost::shared_ptr?
C++
Boost
Null
Pointers
Shared Ptr
invalid use of incomplete type
C++
Templates
Typedef
Crtp
'for' loop vs Qt's 'foreach' in C++
C++
Performance
Qt
Foreach
For Loop
Linux API to list running processes?
C++
C
Linux
Api
Process
Operator< and strict weak ordering
C++
Strict Weak-Ordering
What is the best way to use two keys with a std::map?
C++
Dictionary
Stl
Key
Stdmap
Sizeof string literal
C++
String
Sizeof
Where is Boost.Process?
C++
Boost
Cross Platform
Platform Independent
Boost Process
Template Metaprogramming - Difference Between Using Enum Hack and Static Const
C++
Templates
Metaprogramming
Can I return in void function?
C++
Is there a C++ iterator that can iterate over a file line by line?
C++
File
Iterator
Newline
Line
What will happen when I call a member function on a NULL object pointer?
C++
How do I use Reference Parameters in C++?
C++
Reference Parameters
Can sizeof return 0 (zero)
C++
C
Sizeof
C++ Array of pointers: delete or delete []?
C++
Arrays
Pointers
Delete Operator
C++ fixed point library?
C++
Math
Fixed Point
How to write a std::string to a UTF-8 text file
C++
Utf 8
C++ mutex and const correctness
C++
std::tuple get() member function
C++
Boost
C++11
Tuples
How do I tell gcov to ignore un-hittable lines of C++ code?
C++
Code Coverage
Gcov
Why use an initialization method instead of a constructor?
C++
Constructor
Initialization
Calling Haskell from C++ code
C++
Haskell
Linker
Ffi
Difference between char and char[1]
C++
Arrays
Char
Static Array
Function signature-like expressions as C++ template arguments
C++
Templates
C++: Redirecting STDOUT
C++
How to create two classes in C++ which use each other as data?
C++
Class
Pointers
Header Files
How do I install the OpenSSL libraries on Ubuntu?
C++
Ubuntu
Installation
Openssl
Why do people say there is modulo bias when using a random number generator?
C++
Random
Language Agnostic
Modulo
gcc -g :what will happen
C++
C
Gcc
Gdb
Namespace without a name in C++
C++
Namespaces
Why are SDL and OpenGL related?
C++
C
Opengl
Sdl
Can Qt signals return a value?
C++
Qt
Return Value
Signals Slots
Boost Signals
How to allocate thread local storage?
C++
Linux
Multithreading
New Operator
Thread Local-Storage
Requesting administrator privileges at run time
C++
Windows
Uac
What is the difference between #define and const?
C++
Constants
C Preprocessor
Variadic template templates and perfect forwarding
C++
C++11
Variadic Templates
Template Templates
Cannot convert 'this' pointer from 'const Line' to 'Line &' explanation?
C++
Compiler Errors
Subclass/inherit standard containers?
C++
Standard Library
Inheritance
libgmp-10.dll is missing
C++
Windows
Windows 7
Mingw
Why doesn't Java have initializer lists like in C++?
Java
C++
Constructor
Initialization
Initialization List
How to update an existing element of std::set?
C++
Stl
Set
Does dynamic memory allocation differ in C and C++ in popular implementations?
C++
C
Memory Management
Using AVX CPU instructions: Poor performance without "/arch:AVX"
C++
Performance
Visual Studio-2010
Sse
Avx
Adding to a vector of pair
C++
Vector
Std Pair
How to read a CMake Variable in C++ source code
C++
Makefile
Cmake
Header Files
Does std::vector *have* to move objects when growing capacity? Or, can allocators "reallocate"?
C++
Vector
Realloc
Allocator
Why is my HelloWorld function not declared in this scope?
C++
Scope
How does the custom deleter of std::unique_ptr work?
C++
C++11
Unique Ptr
Delete Operator
C++ templates specialization syntax
C++
Template Specialization
Can't downcast because class is not polymorphic?
C++
Inheritance
Polymorphism
Vtable
How to determine if an object is an instance of certain derived C++ class from a pointer to a base class in GDB?
C++
Types
Gdb
Superclass
Instanceof
Converting a vector<int> to string
C++
String
Vector
C++11 - static_assert within constexpr function?
C++
C++11
Static Assert
Constexpr
Why is the dereference operator (*) also used to declare a pointer?
C++
Pointers
Syntax
Dereference
Notation
Error: expected type-specifier before 'ClassName'
C++
Shared Ptr
Pure Virtual
How to set a boost::optional back to an uninitialized state?
C++
Boost
Boost Optional
How to make a .lib file when have a .dll file and a header file
C++
Dll
Header
Function
gdb: show typeinfo of some data
C++
Gdb
Typeid
Typeinfo
C++ Error 'nullptr was not declared in this scope' in Eclipse IDE
C++
G++
Eclipse Cdt
Why can't I static_cast between char * and unsigned char *?
C++
Char
Reinterpret Cast
Static Cast
Unsigned Char
What are the incompatible differences between C(99) and C++(11)?
C++
C
C++11
C99
Calling a function on every element of a C++ vector
C++
Function
Vector
Multithreading and multicore differences
C++
Multithreading
Multicore
string in namespace std does not name a type
C++
String
Namespaces
Std
What is a stream in C++?
C++
Stream
Filestream
Fstream
What is "Expression SFINAE"?
C++
Templates
Visual C++
C++11
Sfinae
How to enforce the 'override' keyword?
C++
Visual C++
C++11
Visual Studio-2012
Overriding
Should I worry about the alignment during pointer casting?
C++
C
Casting
Alignment
C++11 equivalent to boost shared_mutex
C++
Boost
C++11
Mutex
Read Numeric Data from a Text File in C++
C++
Does initialization entail lvalue-to-rvalue conversion? Is `int x = x;` UB?
C++
Initialization
Undefined Behavior
Language Lawyer
Overloading ++ for both pre and post increment
C++
Operator Overloading
How can I create objects while adding them into a vector?
C++
static constexpr variable vs function
C++
Templates
C++11
Constexpr
Stringification - how does it work?
C++
C
C Preprocessor
Stringification
Initialise Eigen::vector with std::vector
C++
Eigen
shared_ptr<> is to weak_ptr<> as unique_ptr<> is to... what?
C++
C++11
Unique Ptr
Undefined Symbols for architecture x86_64: Compiling problems
C++
Hyperlink
Compilation
Undefined
Symbols
creating a shared_ptr from unique_ptr
C++
C++11
G++
Smart Pointers
Clang++
What is the return type of sizeof operator?
C++
Visual Studio-2010
Sizeof
When would I use std::integral_constant over constexpr?
C++
Templates
C++11
Constants
Constexpr
Passing strings from C# to C++ DLL and back -- minimal example
C#
C++
Pinvoke
Why can't std::ostream be moved?
C++
C++11
Iostream
Why is a = (a+b) - (b=a) a bad choice for swapping two integers?
C++
C
Swap
Undefined Behavior
Sequence Points
Where are clang-format and clang-format.py in Mac OS X with Xcode Command Line Tools installed?
C++
Macos
Clang
Clang Format
Qt Creator, ptrace: Operation not permitted. What is the permanent solution?
C++
Qt
Linux Kernel
Qt5
Linux Mint
gcc: undefined reference to
C++
C
Gcc
Linker
Undefined Reference
cython issue: 'bool' is not a type identifier
Python
C++
Cython
How do I ask for "at least" a size of an int in C
C++
C
Optimization
Unicode in C++11
C++
C++11
Unicode
Utf 8
Utf 16
Why would code explicitly call a static method via a null pointer?
C++
Pointers
Static Members
Undefined Behavior
Dereference
Using `throw;` on a modified exception
C++
Exception
Exception Handling
Language Lawyer
Throw
When is upcasting illegal in C++?
C++
Class
Base
Derived
Downcast
C++11 member initializer list vs in-class initializer?
C++
C++11
Initialization
std::string length() and size() member functions
C++
String
Stl
Size
Is multiplication and division using shift operators in C actually faster?
C++
C
Division
Multiplication
Bit Shift
C++ Force compile-time error/warning on implicit fall-through in switch
C++
Switch Statement
Compiler Warnings
C++ - initializing variables in header vs with constructor
C++
Constructor
Initialization
Why isn't there int128_t?
C++
C
C++ Standard-Library
C Standard-Library
What does casting to `void` really do?
C++
Casting
Compiler Warnings
Void
Suppress Warnings
Is std::is_unsigned<bool>::value well defined?
C++
Boolean
Language Lawyer
C++14
Unsigned
How should I write my C++ to be prepared for C++ modules?
C++
Backwards Compatibility
Future Proof
C++20
C++ Modules
Are function return values automatic objects and thus guaranteed to be destructed?
C++
Exception Handling
Return
Return Value
Language Lawyer
How many constructors does the class have?
C++
Oop
Constructor
constexpr if and static_assert
C++
Templates
Constexpr
C++17
Static Assert
Why is derived class move constructible when base class isn't?
C++
C++11
Language Lawyer
Move Semantics
Move Constructor
Trying to understand lambdas
C++
Lambda
Fast way to write data from a std::vector to a text file
C++
Std
Ofstream
reinterpret_cast creating a trivially default-constructible object
C++
C++11
Language Lawyer
C++17
Why does GCC call libc's sqrt() without using its result?
C++
Gcc
Assembly
X86 64
Why is the destructor called for an object that is not deleted?
C++
Language Lawyer
Overload resolution for inherited functions
C++
Templates
Inheritance
Lambda
Overloading
In C++ do you need to overload operator== in both directions?
C++
Operator Overloading
New iterator requirements
C++
C++ Concepts
C++20
Understanding the as-if rule, "the program was executed as written"
C++
Compiler Optimization
Is C++20 'char8_t' the same as our old 'char'?
C++
C++14
C++20
How to use source_location in a variadic template function?
C++
Variadic Templates
C++20
Default Arguments
Std Source-Location
Why is operator!= removed in C++20 for many standard library types?
C++
C++ Standard-Library
Comparison Operators
C++20
Equality Operator
Do all pointers have the same size in C++?
C++
Pointers
Language Lawyer
Void Pointers
What is the best way to create a sparse array in C++?
C++
Oop
Data Structures
Hash
Maps
Hashtable in C++?
C++
Performance
Map
Hashtable
Complexity Theory
How can currying be done in C++?
C++
Stl
Functional Programming
Currying
Binders
Can you use keyword explicit to prevent automatic conversion of method parameters?
C++
Implicit Conversion
Explicit
What is the difference between "VC++" and "C++"?
C++
Visual C++
Is it safe to assume that STL vector storage is always contiguous?
C++
Stl
Vector
Using strtok with a std::string
C++
Strtok
Python for C++ Developers
C++
Python
C++ class header files organization
C++
Class
File
Header
Organization
Uses for anonymous namespaces in header files
C++
Namespaces
Initialization
Header
Structure of a C++ Object in Memory Vs a Struct
C++
Struct
SSE SSE2 and SSE3 for GNU C++
C++
Optimization
Simd
Sse
Sse2
Different methods for instantiating an object in C++
C++
Object
How much footprint does C++ exception handling add
C++
Exception
Exception Handling
Embedded
Footprint
C/C++: Static function in header file, what does it mean?
C++
C
Function
Static
What is the difference between "new" and "malloc" and "calloc" in C++?
C++
Memory Management
Malloc
Heap Memory
How to run regasm.exe from command line other than Visual Studio command prompt?
.Net
C++
Visual C++
Command Line
Operating System
What is Proxy Class in C++
C++
Design Patterns
Proxy
How are Java generics different from C++ templates? Why can't I use int as a parameter?
Java
C++
Generics
Retrieving a c++ class name programmatically
C++
Class
Macros
#define statements within a namespace
C++
Namespaces
C++ .NET convert System::String to std::string
.Net
C++
String
Marshalling
What's the C++ version of Guid.NewGuid()?
C++
Windows
Winapi
Guid
Why does Qt use its own make tool, qmake?
C++
Qt
Cross Platform
Qmake
How to use SQLite in a multi-threaded application?
C++
Multithreading
Sqlite
How to perform a bitwise operation on floating point numbers
C++
Floating Point
Genetic Algorithm
Bitwise Operators
MinGW linker error: winsock
C++
Linker
Mingw
Winsock
How to print function pointers with cout?
C++
C++ syntax for explicit specialization of a template function in a template class?
C++
Templates
Gcc
How can I determine distance from an object in a video?
C++
Opencv
Computer Vision
Photogrammetry
How to perform atomic operations on Linux that work on x86, arm, GCC and icc?
C++
C
Linux
Atomic
Why does C++ code missing a formal argument name in a function definition compile without warnings?
C++
Compiler Warnings
C++ floating point to integer type conversions
C++
Floating Point
Integer
Type Conversion
Typecast Operator
Can I do Android Programming in C++, C?
C++
Android
unique_ptr boost equivalent?
C++
Boost
C++11
Unique Ptr
What are the pitfalls of ADL?
C++
Namespaces
Overload Resolution
Argument Dependent-Lookup
What does an object file contain?
C++
C
Compilation
new types may not be defined in a return type - C++
C++
Class Design
Compilation
Why do C programmers use typedefs to rename basic types?
C++
C
Is returning void valid code?
C++
C
How does the template parameter of std::function work? (implementation)
C++
Templates
C++11
Function Pointers
Function Object
How much overhead is there when creating a thread?
C++
Pthreads
Posix
C++ Erase vector element by value rather than by position?
C++
Vector
Stl
Erase
Erase Remove-Idiom
Does C++ support 'finally' blocks? (And what's this 'RAII' I keep hearing about?)
C++
Exception
Raii
Finally
C++ Faq
How to sum up elements of a C++ vector?
C++
Stl
Vector
Singleton: How should it be used
C++
Design Patterns
Singleton
Why are unnamed namespaces used and what are their benefits?
C++
Oop
Namespaces
friend declaration declares a non-template function
C++
Templates
Operator Overloading
Friend
Specialization
When is it worthwhile to use bit fields?
C++
C
Bit Fields
Making a class abstract without any pure virtual methods
C++
C++ inlining class methods causes undefined reference
C++
Inline
How to check if enum value is valid?
C++
Enums
Namespaces and operator resolution
C++
Namespaces
Operator Keyword
any good and simple RPC library for inter-process calls?
C++
Rpc
Interprocess
Memory alignment in C-structs
C++
C
Memory
Memory Alignment
Structure Packing
how does cout << actually work?
C++
Cout
Why copying stringstream is not allowed?
C++
Stringstream
Why was pair range access removed from C++11?
C++
Foreach
C++11
Range
Std Pair
Do unused functions get optimized out?
C++
C
Compiler Construction
Template within template: why "`>>' should be `> >' within a nested template argument list"
C++
Templates
Compiler Construction
Vector
Lexicographic
How to change a project's name in QtCreator?
C++
Qt
Qt Creator
What's the relationship between C++ template and duck typing?
C++
Templates
Duck Typing
What is LD_LIBRARY_PATH and how to use it?
Java
C++
Environment Variables
Jacob
Multi-character constant warnings
C++
C
Casting
Compiler Warnings
Portability
How do I check if a StringStream variable is empty/null?
C++
how to check string start in C++
C++
String
Using std::array with initialization lists
C++
C++11
Libstdc++
Writing a "real" interactive terminal program like vim, htop, ... in C/C++ without ncurses
C++
C
Terminal
Interactive
fork() and output
C++
Linux
Unix
Fork
How do I construct an ISO 8601 datetime in C++?
C++
Qt
Azure
dereferencing a pointer when passing by reference
C++
Pointers
Reference
static vs non-static variables in namespace
C++
Static
Namespaces
How to have static data members in a header-only library?
C++
Static Members
Header Only
How to Get enum item name from its value
C++
Enums
Difference between <cstring> and <string>
C++
Visual Studio
G++
C/C++ Why to use unsigned char for binary data?
C++
C
Character Encoding
Bytebuffer
Rawbytestring
c++ issue with function overloading in an inherited class
C++
Class
Inheritance
Overloading
default parameters in .h and .cpp files
C++
Oop
Header Files
How to compile Qt 5 under Windows or Linux, 32 or 64 bit, static or dynamic on Visual Studio or g++
C++
Visual Studio-2010
Qt
Compilation
Visual Studio-2012
Why is inherited member not allowed?
C++
Inheritance
Creating a class object in c++
C++
Class
Get time since epoch in milliseconds, preferably using C++11 chrono
C++
C++11
Chrono
How JVM stack, heap and threads are mapped to physical memory or operation system
Java
C++
Memory
Jvm
Runtime
C++ One std::vector containing template class of multiple types
C++
Templates
Stdvector
What's the best way to lock multiple std::mutex'es?
C++
Multithreading
C++11
Iterating over a struct in C++
C++
Struct
How is Meyers' implementation of a Singleton actually a Singleton
C++
Design Patterns
C++11
Singleton
initial value of reference to non-const must be an lvalue
C++
Pointers
Reference
Why no emplacement iterators in C++11 or C++14?
C++
C++11
Stl
Iterator
C++14
Is there any reason for using if(1 || !Foo())?
C++
C
If Statement
Syntax
Logical Operators
What should a C++ getter return
C++
Getter
Java thread leaks when calling back from native thread via JNI
Java
C++
Multithreading
Callback
Java Native-Interface
std::swap vs std::exchange vs swap operator
C++
Swap
C++14
Is integer multiplication really done at the same speed as addition on a modern CPU?
C++
Performance
Cpu
Multiplication
Addition
What does the single ampersand after the parameter list of a member function declaration mean?
C++
C++11
C++ catching all exceptions
C++
Exception
Strange "->* []" expression in C++ source code of cpp.react library
C++
C++11
Language Lawyer
Operator Arrow-Star
What is the difference between MinGW, MinGW-w64 and MinGW-builds?
C++
Eclipse
Gcc
C++11
Mingw
Where does CLion store executable files?
C++
Cmake
Ubuntu 14.04
Jetbrains Ide
Clion
Make custom type "tie-able" (compatible with std::tie)
C++
C++11
Tuples
Std
Do distinct functions have distinct addresses?
C++
Function Pointers
Language Lawyer
One Definition-Rule
Comdat Folding
Using C++11 futures: Nested calls of std::async crash: Compiler/Standard library bug?
C++
C++11
Gcc
Future
Mingw W64
What is the performance of std::bitset?
C++
Performance
Bitset
C++ Compiler Error C2280 "attempting to reference a deleted function" in Visual Studio 2013 and 2015
C++
Visual C++
Copy Constructor
C++14
How to get NFC working on Android using Qt 5.6
Android
C++
Qt
Nfc
qt5.6
A confusing typedef involves class scope
C++
Typedef
Pointer to-Member
Deleted default constructor. Objects can still be created... sometimes
C++
C++14
Language Lawyer
List Initialization
Aggregate Initialization
How to construct a std::string with embedded values, i.e. "string interpolation"?
C++
String Interpolation
Is it possible to restart a program from inside a program?
C++
Application Restart
Can '\0' and NULL be used interchangeably?
C++
Null
The behaviour of floating point division by zero
C++
Floating Point
Language Lawyer
Undefined Behavior
Divide by-Zero
How to use new std::byte type in places where old-style unsigned char is needed?
C++
Vector
C++17
In a structure, is it legal to use one array field to access another one?
C++
C
Arrays
Struct
Is it possible to catch an exception of lambda type?
C++
Exception
Lambda
Is ++*ptr++ undefined behaviour in c++?
C++
Language Lawyer
Avoiding implicit conversion in constructor. The 'explicit' keyword doesn't help here
C++
C++11
How to get the address of a C++ lambda function within the lambda itself?
C++
C++11
Lambda
C++14
C++17
Why does an object returned by value have the same address as the object inside the method?
C++
C++11
Why use `std::bind_front` over lambdas in C++20?
C++
Lambda
C++20
Stdbind
Bind Front
How can I include a C header that uses a C++ keyword as an identifier in C++?
C++
C
Clang
Why do C++ streams use char instead of unsigned char?
C++
Types
Stream
Overflow
Iostream
Should every class have a virtual destructor?
C++
Virtual Destructor
Obtain a std::ostream either from std::cout or std::ofstream(file)
C++
Exception Handling
Iostream
Difference between C/C++ Runtime Library and C/C++ Standard Library
C++
C
Function References
C++
How do I utilise all the cores for nmake?
C++
Eclipse
Qt
Multicore
Nmake
Overriding a Base's Overloaded Function in C++
C++
Inheritance
Polymorphism
Overriding
Difference between static in C and static in C++??
C++
C
What is a good random number generator for a game?
C++
Performance
Random
Measuring text width in Qt
C++
Qt
Text
Boost.Any vs. Boost.Variant
C++
Boost
Boost Variant
Boost Any
Undefined reference to vtable. Trying to compile a Qt project
C++
Qt
Qmake
Need a fast random generator for c++
C++
Random
Performance
opencv multi channel element access
C++
Image
Image Processing
Opencv
Using std::map<K,V> where V has no usable default constructor
C++
Stl
Map
Compile Time
General C++ Performance Improvement Tips
C++
What are the "things to know" when diving into multi-threaded programming in C++
C++
Multithreading
Why is (void) 0 a no operation in C and C++?
C++
C
Compiler Construction
Usefulness of signaling NaN?
C++
Visual C++
Floating Point
Ieee 754
X87
Cumulative Normal Distribution Function in C/C++
C++
C
Math
Statistics
Distribution
What is uintptr_t data type
C++
Pointers
Types
Differences between unique_ptr and shared_ptr
C++
Pointers
C++11
Shared Ptr
Unique Ptr
How can I read and parse CSV files in C++?
C++
Parsing
Text
Csv
How can I add reflection to a C++ application?
C++
Reflection
Templates
Sfinae
Can the C++ `new` operator ever throw an exception in real life?
C++
Exception
New Operator
Out of-Memory
Higher-kinded Types with C++
C++
Templates
Haskell
Higher Kinded-Types
At what point is it worth using a database?
C++
Sql
Database
Qt
User Interface
Finding the centroid of a polygon?
C++
C
Vector
Vector Graphics
What's the difference between cstdlib and stdlib.h?
C++
Std
Make GNU make use a different compiler
C++
C
Makefile
C/C++: switch for non-integers
C++
C
Switch Statement
Are flexible array members valid in C++?
C++
Flexible Array-Member
Converting cv::Mat to IplImage*
C++
Opencv
Is floating-point == ever OK?
C++
Comparison
Floating Point
How to implement garbage collection in C++
C++
Garbage Collection
Is there const in C?
C++
C
Constants
Language Comparisons
error: expected class-name before ‘{’ token
C++
G++
Should I use shared_ptr or unique_ptr
C++
C++11
Shared Ptr
Pimpl Idiom
Unique Ptr
What are the use cases for having a function return by const value for non-builtin type?
C++
Const Correctness
What is the use of private static member functions?
C++
Static Methods
Private Members
Increment void pointer by one byte? by two?
C++
C
Pointers
One or more multiply defined symbols found
C++
Disabling C++ exceptions, how can I make any std:: throw() immediately terminate?
C++
Exception Handling
G++
Exit
Debugging template instantiations
C++
C++11
C++: Simple return value from std::thread?
C++
Multithreading
Converting std::string to std::vector<char>
C++
Segmentation fault at glGenVertexArrays( 1, &vao );
C++
Debugging
Opengl
Segmentation Fault
Most efficient/elegant way to clip a number?
C++
Algorithm
Math
Logic
Finding the max value in a map
C++
Dictionary
Vector
Max
Mode
How to compile Clang on Windows
C++
C
Windows
Clang
Dynamic casting for unique_ptr
C++
Casting
C++11
Smart Pointers
Unique Ptr
C/C++ int[] vs int* (pointers vs. array notation). What is the difference?
C++
C
Arrays
Pointers
Standards
Move with vector::push_back
C++
C++11
Google Test in Visual Studio 2012
C++
Visual C++
C++11
Visual Studio-2012
Googletest
Expression must be a modifiable lvalue
C++
If Statement
How clear gdb command screen?
C++
C
Gcc
Gdb
Binutils
Why does stringstream >> change value of target on failure?
C++
State
Stringstream
Cin
Delegate Constructor C++
C++
C++11
What does the 'void()' in 'auto f(params) -> decltype(..., void())' do?
C++
C++11
Sfinae
Decltype
Trailing Return-Type
Unit testing c++. How to test private members?
C++
Unit Testing
Testing
localtime vs localtime_s and appropriate input arguments
C++
Localtime
Qt signals (QueuedConnection and DirectConnection)
C++
Qt
Qthread
Qt Signals
Is it required to define the initialization list in a header file?
C++
Initialization List
Does a C++11 range-based for loop condition get evaluated every cycle?
C++
Performance
For Loop
C++11
Foreach
how can I fully disable resizing a window including the resize icon when the mouse hovers the border?
C++
Qt
User Interface
Border
Unresolved external symbol LNK2019
C++
Visual Studio
Linker
Linker Errors
Unresolved External
Sorting a vector of custom objects
C++
Stl
Sorting
Convert a String In C++ To Upper Case
C++
String
Strange definitions of TRUE and FALSE macros
C++
C
Macros
Boolean
Obfuscation
C++ crashes in a 'for' loop with a negative expression
C++
What does the standard say about how calling clear on a vector changes the capacity?
C++
Vector
Language Lawyer
char vs wchar_t vs char16_t vs char32_t (c++11)
C++
C++11
Waiting for multiple futures?
C++
Multithreading
C++11
Node packages not building on Windows 8.1 - Missing Microsoft.Cpp.Default.props
C++
Visual Studio-2010
node.js
Visual Studio-2012
Msbuild
Can I mimic a C header that redefines bool in C++?
C++
C
Typedef
Mixing
Why are std::shuffle methods being deprecated in C++14?
C++
C++11
Deprecated
C++14
Stl Algorithm
version `CXXABI_1.3.8' not found (required by ...)
C++
Linux
Gcc
Boost
gcc4.9
Incomplete type in nested name specifier
C++
Language Lawyer
Can XOR of two integers go out of bounds?
C++
C
Bit Manipulation
Integer Overflow
Bitwise Xor
Are C++ applications cross-platform?
C++
Cross Platform
How do sizeof(arr) / sizeof(arr[0]) work?
C++
Sizeof
Using scientific notation in for loops
C++
Loops
What is the fastest way to update a variable on a condition?
C++
Optimization
Is sizeof(void()) a legal expression?
C++
Language Lawyer
Sizeof
Void
What is double evaluation and why should it be avoided?
C++
Macros
Preprocessor Directive
Difference between execution policies and when to use them
C++
C++17
Why do C++17 structured bindings not use { }?
C++
C++17
Structured Bindings
How does Eric Niebler's implementation of std::is_function work?
C++
C++11
Templates
C++14
Typetraits
How to check if a string contains a char?
C++
Stdstring
Is stateful metaprogramming ill-formed (yet)?
C++
Language Lawyer
Metaprogramming
C++17
Why use abs() or fabs() instead of conditional negation?
C++
C
Variables
Negation
Absolute Value
What's the point of deleting default class constructor?
C++
Default Constructor
Why are std::begin and std::end "not memory safe"?
C++
C++11
Iterator
Std
Why is "using System;" not considered bad practice?
C#
C++
Using Directives
what is the new feature in c++20 [[no_unique_address]]?
C++
Attributes
C++20
Why are my two tuples containing strings, created the same way, not equal?
C++
Visual C++
Tuples
String Literals
What tools do you use to develop C++ applications on Linux?
C++
Linux
Eclipse
Gdb
Valgrind
How large is a DWORD with 32- and 64-bit code?
C++
Winapi
64 Bit
Dword
What is a jump table?
C++
C
Memory
Embedded
What's the best way to do fixed-point math?
C++
Fixed Point
Is it possible to prevent stack allocation of an object and only allow it to be instantiated with 'new'?
C++
C++ Faq
How much memory do Enums take?
Java
C++
Memory
Enums
Undefined Symbol ___gxx_personality_v0 on link
C++
C
Gcc
G++
Array of zero length
C++
Arrays
Visual C++
Flexible Array-Member
Dead code identification (C++)
C++
Static Analysis
Dead Code
Determining exception type after the exception is caught?
C++
Exception
Exception Handling
How to retrieve all keys (or values) from a std::map and put them into a vector?
C++
Dictionary
Stl
Stdmap
What open source C++ static analysis tools are available?
C++
Coding Style
Static Analysis
Random float number generation
C++
Random
Floating Point
How to make my custom type to work with "range-based for loops"?
C++
For Loop
C++11
Customization
What is this smiley-with-beard expression: "<:]{%>"?
C++
Expression
Emoticons
Digraphs
How do I create an array of pointers?
C++
Arrays
Pointers
Best folder structure for C++ cross-platform library and bindings
C++
Cross Platform
How to delete a folder in C++?
C++
Delete Directory
How to remove constness of const_iterator?
C++
Stl
Iterator
Const Iterator
Extending the C++ Standard Library by inheritance?
C++
Stl
Conditional operator differences between C and C++
C++
C
Conditional Operator
How to add two numbers without using ++ or + or another arithmetic operator
C++
C
Algorithm
Bit Manipulation
Any reason to overload global new and delete?
C++
Memory Management
Overloading
Handling stdafx.h in cross-platform code
C++
Visual Studio
Gcc
Cross Platform
stdafx.h
C++ How to find the biggest key in a std::map?
C++
Stl
Map
What is the best autocomplete/suggest algorithm,datastructure [C++/C]
C++
C
Algorithm
Search
Autocomplete
Functional Programming in C++
C++
Functional Programming
How do I force a particular instance of a C++ template to instantiate?
C++
Templates
Instantiation
A most vexing parse error: constructor with no arguments
C++
Constructor
Standards
What is process and thread?
C++
Multithreading
Process
Operating System
What is the underlying data structure of a STL set in C++?
C++
Set
C++ extern keyword on functions. Why no just include the header file?
C++
Linker
Extern
How can I sort an STL map by value?
C++
Algorithm
Sorting
Dictionary
Stl
clean C++ granular friend equivalent? (Answer: Attorney-Client Idiom)
C++
Design Patterns
Private
Friend
QObject: Cannot create children for a parent that is in a different thread
C++
Qt
Change the current working directory in C++
C++
Header
Portability
Working Directory
When to use the Visual Studio Additional dependencies?
C++
Visual Studio
Linker
Member template in local class
C++
Templates
C++11
Local Class
How do I call a static method of another class
C++
Windows
Oop
Mfc
Static Methods
Why does typeid.name() return weird characters using GCC and how to make it print unmangled names?
C++
Gcc
G++
Rtti
2D Euclidean vector rotations
C++
Math
Vector
Rotation
Trigonometry
Creating/writing into a new file in Qt
C++
Qt
Why can't Visual Studio find my DLL?
C++
Visual Studio
Visual Studio-2010
Visual C++
Dll
How to define C++ preprocessor variable in Makefile
C++
Makefile
How define an array of function pointers in C
C++
C
Arrays
Function Pointers
File not recognized: File truncated GCC error
C++
Eclipse
Gcc
std::vector, default construction, C++11 and breaking changes
C++
Stl
Vector
C++11
Backwards Compatibility
Why can't the template argument be deduced when it is used as template parameter to another template?
C++
Templates
Parameters
scope of using declaration within a namespace
C++
Scope
Namespaces
Header Files
Using
error: Class has not been declared despite header inclusion, and the code compiling fine elsewhere
C++
Compiler Errors
Header
Why not have all the functions as virtual in C++?
Java
C++
Virtual Functions
Real life examples of xvalues, glvalues, and prvalues?
C++
C++11
Get current time in milliseconds using C++ and Boost
C++
Boost
Time
Timestamp
Milliseconds
Why can't we pass arrays to function by value?
C++
Arrays
Function
Arguments
Handling header files dependencies with cmake
C++
Dependencies
Cmake
Header Files
Passing C++ Lambda Functions
C++
Lambda
Is RVO (Return Value Optimization) applicable for all objects?
C++
Optimization
Gcc
Where can I find the C++11 standard papers?
C++
C++11
Check if one string is a prefix of another
C++
String Comparison
Prefix
Is returning references of member variables bad practice?
C++
Reference
Member Variables
Android NDK: getting the backtrace
Android
C++
C
Android Ndk
Why is C++11 constexpr so restrictive?
C++
C++11
Constexpr
C++ Linker Error With Class static constexpr
C++
Linker
C++11
Constexpr
How is a vector's data aligned?
C++
Vector
Sse
Memory Alignment
Allocator
How to write a `for` loop over bool values (false and true)
C++
For Loop
Boolean
Why am I getting this ifstream error?
C++
Compiler Errors
Fstream
Ifstream
Is it possible to pass derived classes by reference to a function taking base class as a parameter
C++
Interface
Is make_shared really more efficient than new?
C++
Shared Ptr
Clang
Libc++
Make Shared
what does "error : a nonstatic member reference must be relative to a specific object" mean?
C++
Dll
Compiler Errors
Member Functions
In what cases we need to include <cassert>?
C++
Header Files
Assert
A positive lambda: '+[]{}' - What sorcery is this?
C++
C++11
Lambda
Operator Overloading
Language Lawyer
Why does NaN - NaN == 0.0 with the Intel C++ Compiler?
C++
C
Floating Point
Ieee 754
Icc
How exactly is std::string_view faster than const std::string&?
C++
String
C++17
String View
How do malloc() and free() work?
C++
C
Memory Management
Malloc
Free
Determine if map contains a value for a key?
C++
Stl
Map
std::to_string - more than instance of overloaded function matches the argument list
C++
Visual Studio-2010
Visual C++
C++11
Is it wise to ignore gcc/clang's "-Wmissing-braces" warning?
C++
C++11
Compiler Warnings
Why do we need to mark functions as constexpr?
C++
C++11
Constexpr
std::mutex vs std::recursive_mutex as class member
C++
C++11
Mutex
Object Design
Recursive Mutex
what is the performance impact of using int64_t instead of int32_t on 32-bit systems?
C++
Performance
32bit 64bit
32 Bit
Int64
Does std::atomic<std::string> work appropriately?
C++
Atomic
Stdstring
Stdatomic
How to call a function on all variadic template args?
C++
C++11
Variadic Templates
Strange behaviour of structures in C++ [part 1]
C++
C++11 variable number of arguments, same specific type
C++
C++11
Variadic
g++ ld: symbol(s) not found for architecture x86_64
C++
Opencv
Gcc
template parameter packs access Nth type and Nth element
C++
C++11
Variadic Templates
How to parse a date string into a c++11 std::chrono time_point or similar?
C++
C++11
Date Parsing
Datetime Parsing
How to initialize a vector of vectors on a struct?
C++
Vector
Why does Java read a big file faster than C++?
Java
C++
File
What is the meaning of `struct X typedef` vs. `typedef struct X`?
C++
C
Struct
Visual Studio-2010
Pointers as keys in map C++ STL
C++
Pointers
Map
Stl
Why do C++ classes without member variables occupy space?
C++
Class
Sizeof
Predicate
Is it mandatory to escape tabulator characters in C and C++?
C++
C
What is the correct way to obtain (-1)^n?
C++
Algorithm
X86
Cmath
Is there any difference between QRegularExpression and QRegExp?
C++
Qt
Qt5
Qregexp
Why does Sleep(500) cost more than 500ms?
C++
Winapi
Sleep
Strongly typed using and typedef
C++
C++14
C++17
Fit rectangle around points
C++
Algorithm
Valgrind reporting a segment overflow
C++
Overflow
Valgrind
Callgrind
array of vectors or vector of arrays?
C++
Arrays
Vector
Compact way to write if(..) statement with many equalities
C++
If Statement
How to determine programmatically if an expression is rvalue or lvalue in C++?
C++
C++11
Lvalue
Rvalue
The fastest C++ algorithm for string testing against a list of predefined seeds (case insensitive)
C++
String
Windows
Algorithm
Why are are std::allocator's construct and destroy functions deprecated in c++17?
C++
Memory Management
Language Lawyer
Allocator
C++17
Can C++ code be valid in both C++03 and C++11 but do different things?
C++
C++11
Language Lawyer
C++03
Initialization of all elements of an array to one default value in C++?
C++
Arrays
Initialization
Variable Assignment
Default Value
How do you create a static class in C++?
C++
Oop
Class
Syntax
Static
Meaning of = delete after function declaration
C++
Function
C++11
Declaration
Delete Operator
Optimize in CMake by default
C++
Cmake
Compiler Optimization
Why are pointers to inline functions allowed?
C++
Function
Inline
Did the author make a mistake in explaining stack and heap in C++ or am I misreading something?
C++
C++11
Is it better to remove "const" in front of "primitive" types used as function parameters in the header?
C++
Header
Constants
Primitive Types
How do I specify a clang-format file?
C++
Clang
Llvm
Llvm Clang
Clang Format
Is there any point in using `override` when overriding a pure virtual function?
C++
C++11
Overriding
Pure Virtual
Using declared variable in a range-based for-loop
C++
Initialization of a constant reference with a number
C++
Reference
Constants
Rvalue Reference
How do I check for C++20 support? What is the value of __cplusplus for C++20?
C++
Macros
C++20
Why is unique_ptr not equality_comparable_with nullptr_t in C++20?
C++
Language Lawyer
C++20
C++ Concepts
Is if(A | B) always faster than if(A || B)?
C++
Optimization
Benchmarking
Branch Prediction
Benefits and portability of Boost Library
C++
Boost
What are some best practices for OpenGL coding (esp. w.r.t. object orientation)?
C++
Opengl
Oop
Is !! a safe way to convert to bool in C++?
C++
Visual C++
Boolean
Convert a number to a string with specified length in C++
C++
Integer
Stdstring
Relative performance of std::vector vs. std::list vs. std::slist?
C++
Data Structures
Stl
Performance
Linked List
How can a Windows service execute a GUI application?
C++
Winapi
Windows Services
Waitpid equivalent with timeout?
C++
C
Linux
How do I find the name of the calling function?
C++
Debugging
Building Boost BCP
C++
Boost
Is there any reason to check for a NULL pointer before deleting?
C++
Pointers
Null
Delete Operator
Set local environment variables in C++
C++
C
Manpage
How does a C++ reference look, memory-wise?
C++
Memory Management
Reference
Why Can't I store references in a `std::map` in C++?
C++
Dictionary
Reference
Std
Stdmap
Technical reasons behind formatting when incrementing by 1 in a 'for' loop?
Java
C#
C++
C
For Loop
Why is there a performance warning on cast pointer to bool?
C++
Casting
Performance
C++ class template of specific baseclass
C++
Generics
Inheritance
Templates
catch exception by pointer in C++
C++
Exception Handling
Throw
Try Catch
What do C and Assembler actually compile to?
C++
C
Compiler Construction
Linker
Assembly
What does it mean when a variable appears red in the visual studio C++ debugger?
C++
Visual Studio
Debugging
Variables
I would like to see a hash_map example in C++
C++
Hashmap
return value of operator overloading in C++
C++
Operator Overloading
Linker error: "linker input file unused because linking not done", undefined reference to a function in that file
C++
C
Gcc
Makefile
Linker Errors
C++ header file and function declaration ending in "= 0"
C++
Virtual Functions
Use-cases of pure virtual functions with body?
C++
Virtual Functions
C++ invoke explicit template constructor
C++
Templates
How can I write a power function myself?
C++
Math
Floating Point
Is it possible to set an object to null?
C++
Object
Null
Is Empty
Stdoptional
How is vector implemented in C++
C++
Data Structures
decltype and parentheses
C++
C++11
Type Inference
Decltype
Goto out of a block: do destructors get called?
C++
Destructor
Goto
Is this key-oriented access-protection pattern a known idiom?
C++
Design Patterns
Friend
Access Control
Convert a single character to a string?
C++
Character
Fastest JSON reader/writer for C++
C++
C
Json
Why compiler doesn't allow std::string inside union?
C++
When should Q_OBJECT be used?
C++
Qt
Qobject
Creating a transparent window in C++ Win32
C++
Winapi
Gdi+
Transparency
Alphablending
Why not mark everything inline?
C++
Optimization
Inline
Tradeoff
"dereferencing type-punned pointer will break strict-aliasing rules" warning
C++
Warnings
Strict Aliasing
How to initialize member-struct in initializer list of C++ class?
C++
List
Constructor
Struct
Initializer
ifstream: check if opened successfully
C++
Iostream
Why does a C++ friend class need a forward declaration only in other namespaces?
C++
Namespaces
Friend
Forward Declaration
Boost libraries - build only what I need
C++
Boost
C++ cross-compiler from Windows to Linux
C++
Windows
Linux
Cross Compiling
int to unsigned int conversion
C++
How to properly free a std::string from memory
C++
String
Where and why do I have to put the "template" and "typename" keywords?
C++
Templates
Typename
C++ Faq
Dependent Name
How can I pad an int with leading zeros when using cout << operator?
C++
Formatting
Cout
Purpose of Unions in C and C++
C++
C
Unions
Type Punning
What's the rationale for null terminated strings?
C++
C
String
Null Terminated
no debugging symbols found when using gdb
C++
Gdb
C++11 static_assert and template instantiation
C++
C++11
Returning to beginning of file after getline
C++
What does a single "throw;" statement do?
C++
Exception
Throw
When will C++0x be finished?
C++
C++11
What is the C++ iostream endl fiasco?
C++
Iostream
Endl
What makes a static variable initialize only once?
C++
Variables
Static
Static Variables
Default argument in the middle of parameter list?
C++
Default Arguments
What is the first (int (*)(...))0 vtable entry in the output of g++ -fdump-class-hierarchy?
C++
Gcc
Virtual Functions
Vtable
Move or Named Return Value Optimization (NRVO)?
C++
Optimization
C++11
Move Semantics
Return Value-Optimization
Does vector::erase() on a vector of object pointers destroy the object itself?
C++
Stl
Vector
Pointer vs Variable speed in C++
C++
Performance
Variables
Pointers
Visual Studio debugger error: Unable to start program Specified file cannot be found
C++
C
Visual Studio-2010
Debugging
Visual C++
How do I encode a string to base64 using only boost?
C++
String
Boost
Base64
When to use template vs inheritance
C++
Templates
Inheritance
Reinterpret_cast vs. C-style cast
C++
Casting
any C/C++ refactoring tool based on libclang? (even simplest "toy example" )
C++
Refactoring
Llvm
Clang
In a "for" statement, should I use `!=` or `<`?
C++
Loops
For Loop
Conditional Statements
constexpr overloading
C++
C++11
Overloading
Compile Time-Constant
Constexpr
How to use a member variable as a default argument in C++?
C++
Object
Default
Arguments
Writing robust (color and size invariant) circle detection with OpenCV (based on Hough transform or other features)
C++
Python
C
Opencv
Computer Vision
Non-intersecting line segments while minimizing the cumulative length
C++
Performance
Algorithm
Geometry
Can I initialize an STL vector with 10 of the same integer in an initializer list?
C++
Stl
Constructor
Initializer List
C++ streams confusion: istreambuf_iterator vs istream_iterator?
C++
Istream
Streambuf
Is there a preprocessor directive for detecting C++11x support?
C++
Gcc
C Preprocessor
Preprocessor Directive
Calculate rolling / moving average in C++
C++
Boost
Moving Average
Nullptr and checking if a pointer points to a valid object
C++
C++11 - declaring non-static data members as 'auto'
C++
C++11
Auto
Variable Declaration
What is Linux utility to mangle a C++ symbol name?
C++
Compiler Construction
Dlsym
Demangler
Why SDL defines main macro?
C++
Sdl
Main
Logging values of variables in Android native ndk
Android
C++
Debugging
Logging
Android Ndk
Cleanest way to copy a constant size array in c++11
C++
Arrays
Optimization
C++11
Copy
How do memory_order_seq_cst and memory_order_acq_rel differ?
C++
C++11
Memory Model
Stdatomic
clearing a vector of pointers
C++
Pointers
Memory Leaks
Vector
Why can't simple initialize (with braces) 2D std::array?
C++
Stl
C++11
Initialization
Qt undefined reference to vtable
C++
User Interface
Qt4
Codeblocks
Double free or corruption after queue::push
C++
Runtime Error
Delete Operator
Get index of current element in C++ range-based for-loop
C++
For Loop
C++11
Iteration
Overriding return type in function template specialization
C++
Templates
Write-Only pointer type
C++
C
Pointers
Readonly
Const Correctness
Implementation C++14 make_integer_sequence
C++
Gcc
C++11
C++14
How can I measure CPU time and wall clock time on both Linux/Windows?
C++
C
Performance
Time
Cpu
When to use promise over async or packaged_task?
C++
Asynchronous
Promise
Future
Packaged Task
Structure of Arrays vs Array of Structures
C++
Arrays
Struct
Cuda
Using C-string gives Warning: "Address of stack memory associated with local variable returned"
C++
Pointers
C Strings
What's the difference between sockaddr, sockaddr_in, and sockaddr_in6?
C++
C
Api
Network Programming
Using getline() in C++
C++
String
Getline
C++ Global variable declaration
C++
Variables
Global Variables
fatal error C1010 - "stdafx.h" in Visual Studio how can this be corrected?
C++
Visual Studio
Compiler Construction
Header
Visual Studio 2013 fatal error C1041 /FS
C++
Compiler Errors
Visual Studio-2013
How to safely read a line from an std::istream?
C++
Can I use std::async without waiting for the future limitation?
C++
Multithreading
C++11
Asynchronous
Stdasync
How to execute a functor or a lambda in a given thread in Qt, GCD-style?
C++
Multithreading
Qt
How can I loop through a C++ map of maps?
C++
Loops
Dictionary
Iteration
Idioms
How do I best silence a warning about unused variables?
C++
Gcc
Warnings
Gcc Warning
Why is there no C++11 threadsafe alternative to std::localtime and std::gmtime?
C++
C++11
Thread Safety
Chrono
Is there a standard definition for __cplusplus in c++14?
C++
C++14
Visual studio 2013 "A task was cancelled"
C++
Visual Studio-2013
Msbuild
Visual Studio-2015
How to include external library (boost) into CLion C++ project with CMake?
C++
Boost
Cmake
Clion
error: anachronistic old-style base class initializer
C++
C++11
Gcc
C++14
C++03
Why doesn't a using-declaration work to solve the diamond problem?
C++
Inheritance
Subclass
Using Directives
Diamond Problem
note: 'person::person()' is implicitly deleted because the default definition would be ill-formed
C++
Struct
G++
Efficient way to OR adjacent bits in 64-bit integer
C++
Bit Manipulation
Template partial specialization for integral non-type parameters and non-integral non-types, difference between g++ and clang
C++
Templates
Template Specialization
Partial Specialization
Is final used for optimization in C++?
C++
C++11
Virtual
Final
Is capacity copied in a vector?
C++
Vector
Are there any downsides to marking all variables you don't modify const?
C++
Refactoring
Constants
Does std::array<> guarantee allocation on the stack only?
C++
Arrays
Stack
Dynamic Allocation
Static Allocation
Get size of std::array without an instance
C++
C++11
Stdarray
How can I declare a member vector of the same class?
C++
Templates
Vector
Member
Incomplete Type
How does this float square root approximation work?
C++
C
Optimization
Floating Point
Ieee 754
Visual Studio error D8016: '/ZI' and '/Gy' command-line options are incompatible
C++
Visual Studio-2015
Why create an include/ directory in C and C++ projects?
C++
C
Include
Ternary operator implicit cast to base class
C++
Language Lawyer
C++17
Ternary Operator
Implicit Conversion
Access to protected member through member-pointer: is it a hack?
C++
Language Lawyer
Protected
Access Specifier
Member Pointers
C vs C++ compilation incompatibility - does not name a type
C++
C
Gcc
G++
Is std::memcpy between different trivially copyable types undefined behavior?
C++
Language Lawyer
C++17
Undefined Behavior
Strict Aliasing
Why can const char* const & = "hello" compile?
C++
Reference
Constants
Language Lawyer
Simplest way to determine return type of function
C++
Function
C++17
Return Type
Compile Time
Why are `&array` and `array` pointing to the same address?
C++
Arrays
Pointers
Is there a way to shorten this while condition?
C++
Algorithm
If Statement
While Loop
Simplify
What's a good pattern to calculate a variable only when it is used the first time?
C++
Is it possible to get a pointer to one subobject via a pointer to a different, unreleated subobject?
C++
Pointers
Language Lawyer
C++17
Offsetof
Removed operator!= in C++20 standard library
C++
Deprecated
C++ Standard-Library
Comparison Operators
C++20
Why must I provide 'operator ==' when 'operator <=>' is enough?
C++
Language Lawyer
C++20
Language Design
Spaceship Operator
Difference between managed C++ and C++
C++
Visual C++
Programming Languages
Managed C++
Difference between Enum and Define Statements
C++
C
Enums
C Preprocessor
Weird MSC 8.0 error: "The value of ESP was not properly saved across a function call..."
C++
Visual C++
X86
Stack
Calling Convention
Pros & Cons of putting all code in Header files in C++?
C++
Architecture
Compilation
Header Files
Circular Dependency
How do you validate that a string is a valid IPv4 address in C++?
C++
String
Exception vs Assert?
C++
Exception
Throw
Good tools for creating a C/C++ parser/analyzer
C++
C
Parsing
Yacc
Lex
Is there a reason to call delete in C++ when a program is exiting anyway?
C++
Memory Management
Dynamic
Heap Memory
sizeof a union in C/C++
C++
C
Sizeof
Unions
Optimizing member variable order in C++
C++
Performance
Optimization
Embedded
Why use precompiled headers (C/C++)?
C++
Precompiled Headers
How do you determine the size of an object in C++?
C++
Class
Memory
Size
Memory Management
Can I increment an iterator by just adding a number?
C++
Iterator
Function pointers casting in C++
C++
Casting
Function Pointers
Why can't you use offsetof on non-POD structures in C++?
C++
Offsetof
Difference in behavior while using dynamic_cast with reference and pointers
C++
Casting
Dynamic Cast
How can I see symbols of (C and C++) binary on linux?
C++
C
Performance
Profiling
Name Mangling
How to get Python exception text
C++
Python
Exception
Boost Python
Are == and != mutually dependent?
C++
Operator Overloading
Equality
Equality Operator
Why does C++11's lambda require "mutable" keyword for capture-by-value, by default?
C++
Lambda
C++11
Why the switch statement cannot be applied on strings?
C++
String
Switch Statement
LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
C++
Visual Studio
Dll
Linker
Linker Warning
Who deletes the memory allocated during a "new" operation which has exception in constructor?
C++
Exception
Memory Leaks
Constructor
Code with undefined behavior in C#
C#
C++
Undefined Behavior
Does the restrict keyword provide significant benefits in gcc/g++?
C++
C
Gcc
G++
Restrict Qualifier
Easy way find uninitialized member variables
C++
Findbugs
Initialization
Is it possible to use boost::foreach with std::map?
C++
Boost
Foreach
Header file best practices for typedefs
C++
Typedef
How to make google-test classes friends with my classes?
C++
Friend
Googletest
Serialization with Qt
C++
Qt
Serialization
Qt4
How to Detect the Number of Physical Processors / Cores on Windows, Mac and Linux
C++
Windows
Macos
Assembly
Hyperthreading
Which Cross Platform Preprocessor Defines? (__WIN32__ or __WIN32 or WIN32 )?
C++
Macros
C Preprocessor
If I do a `typedef` in C or C++, when should I add `_t` at the end of typedef'ed type?
C++
C
Typedef
shared_ptr: horrible speed
C++
Performance
Compiler Construction
Shared Ptr
Significance of Sleep(0)
C++
Visual C++
Process
Sleep
Can the 'type' of a lambda expression be expressed?
C++
Stl
Lambda
C++11
Why C-forkbombs don't work like bash ones?
C++
C
Linux
Bash
Fork
Is C/C++ bool type always guaranteed to be 0 or 1 when typecast'ed to int?
C++
C
Boolean
Is `long` guaranteed to be at least 32 bits?
C++
Standards
Long Integer
Language Lawyer
QT : Templated Q_OBJECT class
C++
Qt
Templates
Signals Slots
private constructor
C++
Private Constructor
C++ string to double conversion
C++
String
File
Double
Finding memory leaks in a C++ application with Visual Studio
C++
Visual Studio
Visual Studio-2010
Memory Leaks
Valgrind
C++ - value of uninitialized vector<int>
C++
Vector
Scope
Initialization
Check if two vectors are equal
C++
Vector
Set
Why do multiple-inherited functions with same name but different signatures not get treated as overloaded functions?
C++
Scope
Overloading
Multiple Inheritance
Read a text file line by line in Qt
C++
Qt
Split string by single spaces
C++
String
What serious alternatives exist for the IOStream library? (besides cstdio)
C++
Iostream
Is there any advantage to using pow(x,2) instead of x*x, with x double?
C++
Math
Floating Point
Efficient implementation of binary heaps
C++
Data Structures
Performance
Computer Science
Priority Queue
C++, __try and try/catch/finally
C++
Exception Handling
Try Catch
Finally
Where can I find an official reference listing the operation of SSE intrinsic functions?
C++
C
Gcc
Sse
Simd
Unusual typedef use in C++
C++
Typedef
"string could not resolved" error in Eclipse for C++ (Eclipse can't resolve standard library)
C++
Eclipse
C++ Virtual template method
C++
Templates
Virtual
How to capture a unique_ptr into a lambda expression?
C++
Lambda
C++11
Unique Ptr
Why does C need "struct" keyword and not C++?
C++
C
Compiler Construction
How to define a C++ preprocessor macro through the command line with CMake?
C++
Cmake
call to pure virtual function from base class constructor
C++
Constructor
Abstract Class
Object Lifetime
Pure Virtual
Is the std::set iteration order always ascending according to the C++ specification?
C++
Stl
Set
What's the difference between notify_all() and notify_one() of std::condition_variable?
C++
Multithreading
C++11
Condition Variable
how to assign multiple values into a struct at once?
C++
C
Struct
CMake: How to pass preprocessor macros
C++
Cmake
Where does the value of CXX in a makefile come from?
C++
C
Makefile
Differentiate between function overloading and function overriding
C++
Overloading
Overriding
What header defines NULL in C++?
C++
Null
Using C Libraries for C++ Programs
C++
C
Robotics
Difference between angle bracket < > and double quotes " " while including header files in C++?
C++
C
C++11
Error: Jump to case label in switch statement
C++
Switch Statement
Forward declaring an enum in C++
C++
Enums
How much faster is C++ than C#?
C#
C++
Performance
Benchmarking
Passing capturing lambda as function pointer
C++
C++11
Lambda
Function Pointers
Why does C++11 have `make_shared` but not `make_unique`
C++
C++11
Is it possible to manually define a conversion for an enum class?
C++
Enums
C++11
Enum Class
Fortran vs C++, does Fortran still hold any advantage in numerical analysis these days?
C++
C
Cuda
Fortran
Understanding the difference between f() and f(void) in C and C++ once and for all
C++
C
Function
Void
iter_swap() versus swap() -- what's the difference?
C++
Swap
Is there a way to mark a chunk of allocated memory readonly?
C++
C
Memory Management
Malloc
Heap Corruption
What is decltype with two arguments?
C++
C++11
Sfinae
Typetraits
Decltype
Is a moved-from vector always empty?
C++
C++11
Vector
Language Lawyer
Move Semantics
How to initialize static members in the header
C++
Class
Static Members
How to remove element not at top from priority_queue?
C++
Stl
Priority Queue
Binary Heap
Ubuntu - Linking boost.python - Fatal error: pyconfig cannot be found
C++
Ubuntu
Gcc
Boost
Boost Python
Is C++ allowed to increase the derived class size if there're no new member variables compared to the base class?
C++
Inheritance
Sizeof
Language Lawyer
How to access C++ enum from QML?
C++
Qt
Qml
Qtquick2
Getting LibCurl to work with Visual Studio 2013
C++
Visual C++
Dll
Libcurl
Why do constant expressions have an exclusion for undefined behavior?
C++
C++11
Undefined Behavior
Sfinae
Constexpr
How true is "Want Speed? Pass by value"
C++
C++11
Is there a tab equivalent of std::endl within the standard library?
C++
Std
Why is the destructor of a future returned from `std::async` blocking?
C++
Multithreading
C++11
Asynchronous
Std
In f(x), can x be evaluated before f?
C++
C++11
Cast Eigen::MatrixXd to Eigen::MatrixXf
C++
Move semantics and function order evaluation
C++
C++11
Initialization
Move Semantics
Unspecified Behavior
How to print __int128 in g++?
C++
Iostream
Int128
Writing .csv files from C++
C++
Csv
How to create std::array with initialization list without providing size directly
C++
Initialization
Stdarray
Parsing a binary file. What is a modern way?
C++
Casting
Binary
What is shared_ptr's aliasing constructor for?
C++
C++11
Why does pointer decay take priority over a deduced template?
C++
Arrays
Overload Resolution
Visual Studio warning about copies of files with different contents
C++
Visual Studio
What happens to unique_ptr after std::move()?
C++
Unique Ptr
What makes moving objects faster than copying?
C++
Move
Rvalue
Why does std::pair expose member variables?
C++
Stl
Encapsulation
Restrict variadic template arguments
C++
Templates
Variadic Templates
C++17
C++ Faq
Why is pow(int, int) so slow?
C++
Performance
Pow
Cmath
How do I remove code duplication between similar const and non-const member functions?
C++
Class
Constants
Code Duplication
C++ Faq
Why doesn't C++ have a garbage collector?
C++
Garbage Collection
C++11
What is the difference between new/delete and malloc/free?
C++
Memory Management
Pointer to class data member "::*"
C++
Class
Pointers
C++ Faq
macOS Clang C++17 filesystem header not found
C++
Macos
Gcc
Clang
C++17
Why is S::x not odr-used?
C++
Language Lawyer
C++17
Is it possible in modern C++ to pass a string literal as a parameter to a C++ template?
C++
C++17
C++20
How to write C++ getters and setters
C++
Getter Setter
C++ Faq
What's the meaning of "reserved for any use"?
C++
C
Language Lawyer
C Standard-Library
Using throw to replace return in C++ non-void functions
C++
Exception Handling
Do std::min(0.0, 1.0) and std::max(0.0, 1.0) yield undefined behavior?
C++
Floating Point
Language Lawyer
Undefined Behavior
C++ Standard-Library
Why is std::move not [[nodiscard]] in C++20?
C++
C++17
Language Lawyer
C++20
Nodiscard
Catalina C++: Using <cmath> headers yield error: no member named 'signbit' in the global namespace
C++
Macos
Clang
Toolchain
Macos Catalina
Template friendly string to numeric in C++
C++
String Conversion
Absolute value abs(x) using bitwise operators and Boolean logic
C++
C
Bit Manipulation
Language Lawyer
Absolute Value
Initialize multiple constant class members using one function call C++
C++
Oop
Constructor
Constants
Initializer List
What is the best free memory leak detector for a C/C++ program and its plug-in DLLs?
C++
C
Visual Studio
Memory Leaks
STL vectors with uninitialized storage?
C++
Optimization
Stl
Vector
How can I disable #pragma warnings?
C++
Warnings
Pragma
RAII vs. exceptions
C++
Exception
Raii
Destructor
Does delete work with pointers to base class?
C++
Boost
Polymorphism
How do you build the x64 Boost libraries on Windows?
C++
Visual Studio-2005
Boost
64 Bit
Boost Build
Cleaning up an STL list/vector of pointers
C++
List
Vector
Stl
Forward declare a standard container?
C++
Header
C++ Standard-Library
Algorithm for finding the smallest power of two that's greater or equal to a given value
C++
Algorithm
Assembly
What's the deal with boost.asio and file i/o?
C++
Boost
File Io
Boost Asio
How can I read and manipulate CSV file data in C++?
C++
Csv
How expensive is it to dereference a pointer?
C++
Pointers
Why is it impossible to have a reference-to-void?
C++
Reference
Void Pointers
C++: is string.empty() always equivalent to string == ""?
C++
String
Boost considered harmful?
C++
Boost
What does this error mean: "error: expected specifier-qualifier-list before 'type_name'"?
C++
C
Pointers
Struct
Why do I need to use typedef typename in g++ but not VS?
C++
G++
Typedef
Typename
What is ** in C++?
C++
Pointers
Accessing class members on a NULL pointer
C++
Null
Virtual
Null Pointer
How to convert C++ Code to C
C++
C
Code Translation
track C++ memory allocations
C++
Windows
Memory Management
Visualization
What is the point of make_heap?
C++
Stl
Language Design
What is the underlying type of a c++ enum?
C++
Enums
Size
Types
Hex
What is the Fastest Method for High Performance Sequential File I/O in C++?
C++
Performance
File Io
C/C++, can you #include a file into a string literal?
C++
C
Include
C Preprocessor
String Literals
What language is .NET Framework written in?
.Net
C++
Programming Languages
Check double variable if it contains an integer, and not floating point
C++
C
Floating Point
Do I need a mutex for reading?
C++
Multithreading
Mutex
Why must I put a semicolon at the end of class declaration in C++?
C++
Visual Studio: Run C++ project Post-Build Event even if project is up-to-date
C++
Visual Studio
Post Build-Event
Regsvr32
Are there any better methods to do permutation of string?
C++
Algorithm
String
Permutation
Are there any downsides with using make_shared to create a shared_ptr
C++
Boost
Shared Ptr
C structure and C++ structure
C++
C
GCC style weak linking in Visual Studio?
C++
C
Visual Studio
Gcc
Weak Linking
Is there pointer in C# like C++? Is it safe?
C#
C++
Data Structures
Tree
In C++, what does & mean after a function's return type?
C++
Extra leading zeros when printing float using printf?
C++
C
Floating Point
Formatting
Printf
Overload on reference, versus sole pass-by-value + std::move?
C++
C++11
Move Semantics
Rvalue Reference
Embed Text File in a Resource in a native Windows Application
C++
C
Winapi
Resources
Text Files
How to store array in one column in Sqlite3?
C++
Sqlite
How do I use an enum value in a switch statement in C++?
C++
Enums
Switch Statement
Can a destructor be recursive?
C++
Destructor
Standards Compliance
boost spirit semantic action parameters
C++
Parsing
Semantics
Boost Spirit
Boost Spirit-Qi
Why are C++ STL iostreams not "exception friendly"?
C++
Exception
Stl
Iostream
Why doesn't C++ have virtual variables?
C++
What is the difference between std::list<std::pair> and std::map in C++ STL?
C++
Stl
Stdmap
Std Pair
Stdlist
C++ template compilation error: expected primary-expression before ‘>’ token
C++
Visual C++
Gcc
Boost
Compiler Errors
When to pass by reference and when to pass by pointer in C++?
C++
Specifying one type for all arguments passed to variadic function or variadic template function w/out using array, vector, structs, etc?
C++
Templates
Parameters
C++11
Variadic Functions
What does "typedef void (*Something)()" mean
C++
Typedef
Static Members
Void Pointers
C++ object created with new, destroyed with free(); How bad is this?
C++
Memory Management
Interview question - Search in sorted array X for index i such that X[i] = i
Java
C++
Arrays
Algorithm
Are global variables bad?
C++
C
Global Variables
How to convert a char array to a string?
C++
String
Char
Arrays
Qt compiler warning: overriding commands for target / ignoring old commands for target
C++
Qt
Qmake
Moc
Preferred conversion from char (not char*) to std::string
C++
String
Char
Type Conversion
C++ - struct vs. class
C++
Why doesn't C++ support functions returning arrays?
C++
Arrays
Function
Graph implementation C++
C++
Graph
Will std::string always be null-terminated in C++11?
C++
String
C++11
Language Lawyer
Null Terminated
size vs capacity of a vector?
C++
Vector
Calculating normals in a triangle mesh
C++
Opengl
Computational Geometry
Normals
In C/C++, is there a directive similar to #ifndef for typedefs?
C++
C
Tag dispatch versus static methods on partially specialised classes
C++
Metaprogramming
Generic Programming
Partial Specialization
Are there any efforts to create a package manager for C++?
C++
Package Managers
Understanding Recursion to generate permutations
C++
Recursion
Why can't we have automatically deduced return types?
C++
C++11
Can Google Mock a method with a smart pointer return type?
C++
Unit Testing
Smart Pointers
Googlemock
Linking dll in Visual Studio
C++
Visual Studio
Repeated typedefs - invalid in C but valid in C++?
C++
C
Typedef
Language Lawyer
A pointer to 2d array
C++
Arrays
Pointers
Multidimensional Array
Are pure virtual methods allowed within a template class?
C++
Templates
Virtual
How does one iterate through an unordered set in C++?
C++
C++11
Iteration
Unordered Set
What is the difference between char a[] = ?string?; and char *p = ?string?;?
C++
Pointers
Save cURL content result into a string in C++
C++
Curl
Double precision - decimal places
C++
C
Precision
Ieee 754
How to fix C++ error: expected unqualified-id
C++
How get next (previous) element in std::list without incrementing (decrementing) iterator?
C++
List
Iterator
Braces around string literal in char array declaration valid? (e.g. char s[] = {"Hello World"})
C++
C
String
Arrays
Array Initialization
Cross-compilation for Raspberry Pi in GCC. Where to start?
C++
Gcc
Arm
Cross Compiling
Raspberry Pi
When can outer braces be omitted in an initializer list?
C++
C++11
Visual C++-2010
Why is it not possible to overload class templates?
C++
Templates
Overloading
Template Specialization
Language Lawyer
What does an ampersand after this assignment operator mean?
C++
C++11
Assignment Operator
Default Implementation
Getting mangled name from demangled name
C++
G++
Name Mangling
How to copy a string of std::string type in C++?
C++
String
Copy
What does the standard library guarantee about self move assignment?
C++
Stl
C++11
Move Semantics
Memset Definition and use
C++
C
Function
What is the use of wchar_t in general programming?
C++
Why is std::vector so much more popular than std::deque?
C++
Vector
Deque
String literal matches bool overload instead of std::string
C++
String
Boolean
Overloading
Overload Resolution
How to use C++ std::ostream with printf-like formatting?
C++
Formatting
Printf
Ostream
How do I open an .exe from another C++ .exe?
C++
Windows
Exe
HSB vs HSL vs HSV
C++
Colors
Hsv
Hsl
Hsb
Why can I not brace initialize a struct derived from another struct?
C++
C++11
Struct
List Initialization
std::remove_reference explained?
C++
Templates
C++11
Template Specialization
QTextEdit vs QPlainTextEdit
C++
Qt
Qt5
Qtextedit
Qplaintextedit
Windows C++ compiler with full C++11 support (should work with Qt)
C++
Windows
Qt
C++11
Why does the string returned by ctime() contain a line feed?
C++
C
String
Time
Std
How to let cmake find CUDA
C++
Build
Cuda
Cmake
State of the art C++ Unit Testing?
C++
Visual Studio
Unit Testing
Cross Platform
Write applications in C or C++ for Android?
C++
C
Android
Is it possible to declare two variables of different types in a for loop?
C++
Scope
Declaration
For Loop
.c vs .cc vs. .cpp vs .hpp vs .h vs .cxx
C++
C
Filenames
Header Files
Naming
Is there any use for unique_ptr with array?
C++
C++11
Smart Pointers
Unique Ptr
What are some uses of template template parameters?
C++
Templates
Template Templates
How to correctly implement custom iterators and const_iterators?
C++
Iterator
Const Iterator
When do I use a dot, arrow, or double colon to refer to members of a class in C++?
C++
C++ Faq
Is std::unique_ptr<T> required to know the full definition of T?
C++
Visual Studio-2010
C++11
Stl
Unique Ptr
Force the compiler to ignore some lines in the program
C++
Preprocessor Directive
c++ "Incomplete type not allowed" error accessing class reference information (Circular dependency with forward declaration)
C++
Class
Reference
Forward Declaration
c++ and opencv get and set pixel color to Mat
C++
Opencv
Image Processing
Pixel
Mat
How to use hardware acceleration with ffmpeg
C++
C
Ffmpeg
Hardware Acceleration
error: overloaded 'operator<<' must be a binary operator (has 3 parameters)
C++
Operator Overloading
Overloading
Why is Clang optimizing this code out?
C++
Clang
Compiler Optimization
Delayed start of a thread in C++ 11
C++
Multithreading
C++11
For { A=a; B=b; }, will "A=a" be strictly executed before "B=b"?
C++
C
Optimization
Compiler Construction
Standards
fatal error: mpi.h: No such file or directory #include <mpi.h>
C++
C
Mpi
Openmpi
const vector implies const elements?
C++
Constants
Is the "lazy man's enable_if" legal C++?
C++
C++11
Visual C++
Language Lawyer
Sfinae
Memory Leak Detectors Working Principle
C++
C
Memory Leaks
Why does clang++ destroy only one foo object?
C++
Clang
Compilation error: "stddef.h: No such file or directory"
C++
G++
Cygwin
Is undefined behavior only an issue if you are deploying on several platforms?
C++
Undefined Behavior
What does "Symbol not found / Expected in: flat namespace" actually mean?
Python
C++
Import
Namespaces
Importerror
What are unevaluated contexts in C++?
C++
C++11
Can't a class have static constexpr member instances of itself?
C++
C++11
Constexpr
Static Members
Incomplete Type
C++ - Why is boost::hash_combine the best way to combine hash-values?
C++
C++11
Boost
Hash
What is the name of this unusual C++ template feature used by Boost.Spirit?
C++
Templates
C++11
Language Lawyer
Boost Spirit
Getting bool from C to C++ and back
C++
C
Do current x86 architectures support non-temporal loads (from "normal" memory)?
C++
Caching
X86
Cpu Cache
Prefetch
Moving a member function from base class to derived class breaks the program for no obvious reason
C++
C++11
Templates
Namespaces
Uses of destructor = delete;
C++
C++11
Destructor
Could I use operator == if I only implemented operator <?
C++
Operator Overloading
c++ {*this} inside curly braces
C++
C++11
How do I install Windows 10 SDK for use with Visual Studio 2017
C++
Visual Studio-2017
Windows 10
Directx
C++20 bit_cast vs reinterpret_cast
C++
Language Lawyer
Type Alias
C++20
Pointer arithmetics with two different buffers
C++
Pointers
Language Lawyer
Pointer Arithmetic
std::optional - construct empty with {} or std::nullopt?
C++
C++17
Optional
alignof(T) with T=__m512 is not equal to alignof(__m512)
C++
Clang++
How does the C++ compiler evaluate recursive constexpr functions so quickly?
C++
Function
Recursion
Constexpr
Best practices for debugging linking errors
C++
Visual Studio
Gcc
Linker
Compilation
C++ inheritance and member function pointers
C++
Inheritance
Oop
Member Function-Pointers
How do I prevent a class from being allocated via the 'new' operator? (I'd like to ensure my RAII class is always allocated on the stack.)
C++
Operator Overloading
C++ Faq
Your preferred C/C++ header policy for big projects?
C++
C
Coding Style
Include
Header
How to link using GCC without -l nor hardcoding path for a library that does not follow the libNAME.so naming convention?
C++
C
Gcc
Linker
Shared Libraries
Constants and compiler optimization in C++
C++
Optimization
Compiler Construction
Generic vector of vectors in C++
C++
Stl
initializing std::string from char* without copy
C++
String
Memory Management
Stl
Inheriting constructors
C++
Inheritance
Gcc
Constructor
NULL vs nullptr (Why was it replaced?)
C++
Pointers
Null
Nullptr
Does casting to an int after std::floor guarantee the right result?
C++
Math
Floor
How can I refactor C++ source code using emacs?
C++
Emacs
Refactoring
Using local classes with STL algorithms
C++
Stl
Stl Algorithm
how to perform boost::filesystem copy_file with overwrite
C++
Windows
Boost
Boost Filesystem
C++ iterators considered harmful?
C++
Iterator
Language Design
How do I install a c++ library so I can use it?
C++
Windows
Installation
Mingw
What is activation record in the context of C and C++?
C++
C
How to write an unsigned short int literal?
C++
Types
C++ Compare char array with string
C++
String
String Comparison
Is it safe to read an integer variable that's being concurrently modified without locking?
C++
Multithreading
Concurrency
Problems with Singleton Pattern
C++
Design Patterns
Singleton
Where can I set path to make.exe on Windows?
C++
Registry
Makefile
Path
Msys
C++ MFC vs .NET?
C#
.Net
C++
Mfc
Visual C++
Memset on vector C++
C++
Vector
Undefined symbols "vtable for ..." and "typeinfo for..."?
C++
Linker Errors
Undefined Reference
Vtable
Pure Virtual
How can I make the map::find operation case insensitive?
C++
String
Dictionary
Stl
Case Insensitive
array vs vector vs list
C++
Arrays
List
Stl
Vector
mixing cout and printf for faster output
C++
Performance
Printf
Cout
Why are drivers and firmwares almost always written in C or ASM and not C++?
C++
C
Which macro to wrap Mac OS X specific code in C/C++
C++
C
Xcode
Macos
Macros
How do I create a header-only library?
C++
Header Only
How to improve Visual C++ compilation times?
C++
Visual C++
Gcc
Comparison
Compilation Time
What does the "c" mean in cout, cin, cerr and clog?
C++
Iostream
Standard Library
Difference between InvalidateRect and RedrawWindow
C++
Winapi
Redraw
Can a c++ class include itself as an member?
C++
ISO/IEC Website and Charging for C and C++ Standards
C++
C
Standards
Iso
Why does left shift operation invoke Undefined Behaviour when the left side operand has negative value?
C++
C
Language Lawyer
Undefined Behavior
Bit Shift
Default class inheritance access
C++
Inheritance
Checking whether a vector is empty
C++
Stl
Vector
Class members that are objects - Pointers or not? C++
C++
Memory
Pointers
Class Design
Member
What are Containers/Adapters? C++
C++
Stl
Containers
Adapter
Batch Geocoding with Garmin Mapsource
C++
Geocoding
Garmin
Templated class specialization where template argument is a template
C++
Templates
Does dereferencing a pointer make a copy of it?
C++
Pointers
Dereference
Display QImage with QtGui
C++
Qt
Qimage
Qtgui
C++ static member variable and its initialization
C++
Initialization
Static Variables
Qt Designer C++ or QML for GUI
C++
Qt
User Interface
Qml
Choosing between WPF/C# and Qt/C++
C#
C++
Wpf
Qt
User Interface
Reverse map lookup
C++
Stl
Map
Is there a preprocessor define that is defined if the compiler is MSVC?
C++
Visual C++
C Preprocessor
Catching exception: divide by zero
C++
Exception Handling
Conversion function for error checking considered good?
C++
Error Handling
how to include git commit-number into a c++ executable?
C++
Git
Makefile
Detect 32-bit or 64-bit of Windows
C++
Windows
32bit 64bit
linux perf: how to interpret and find hotspots
C++
Linux
Performance
Profiling
Perf
"#ifdef" inside a macro
C++
C Preprocessor
Difference between char* and char[]
C++
Resizing a C++ std::vector<char> without initializing data
C++
Stl
Vector
Resize
Recursively iterate over all the files in a directory and its subdirectories in Qt
C++
Qt
Vector arguments in Boost Program Options
C++
Boost
Boost Program-Options
Does a c++ struct have a default constructor?
C++
Return reference to a vector member variable
C++
Vector
Reference
Constants
Unknown type name 'class'; did you mean 'Class'?
C++
Objective C
Ios5
Multiple instances of singleton across shared libraries on Linux
C++
Singleton
Dlopen
How to draw text using only OpenGL methods?
C++
C
Opengl
Graphics
How to end C++ code
C++
If you shouldn't throw exceptions in a destructor, how do you handle errors in it?
C++
Exception
Destructor
Raii
How does delete[] "know" the size of the operand array?
C++
Why does rand() yield the same sequence of numbers on every run?
C++
Random
invalid use of non-static data member
C++
How can the C++ Eigen library perform better than specialized vendor libraries?
C++
Performance
Eigen
C++ vector that *doesn't* initialize its members?
C++
Stl
Vector
How to define a template member function of a template class
C++
Templates
Standard no-op output stream
C++
Iostream
Floating point format for std::ostream
C++
Floating Point
Cout
Ostream
C++ Destructors with Vectors, Pointers,
C++
Destructor
Why do I need strand per connection when using boost::asio?
C++
Boost
Boost Asio
"Implicit instantiation of undefined template" when forward declaring template class
C++
Templates
Clang
Forward Declaration
Is this ->> an old operator or a typo/error?
C++
C
Operators
History
QByteArray to QString
C++
Qt
Qstring
Qtcore
Qbytearray
Best way to declare an interface in C++11
C++
Interface
C++11
Polymorphism
Abstract
How to deal with "exit-time destructor" warning in clang?
C++
C++11
Warnings
Clang
Destructor
precise time measurement
C++
Visual Studio-2010
Chrono
Ctime
Correct printf format specifier for size_t: %zu or %Iu?
C++
C
Visual Studio-2010
Printf
Format Specifiers
Building Qt5 with Visual Studio 2012 / Visual Studio 2013, and integrating with the IDE
C++
Visual Studio-2012
Visual Studio-2013
Qt5
Directx 11
How to delete all rows from QTableWidget
C++
Qt
Qtablewidget
How to make the for each loop function in C++ work with a custom class
C++
List
C++11
Foreach
How do I create a library?
C++
Compilation
Makefile
Why does JavaScript appear to be 4 times faster than C++?
Javascript
C++
Performance
Floating Point
Benchmarking
Converting a hex string to a byte array
C++
String
Hex
Recursive lambda functions in C++14
C++
Lambda
C++14
How to interpret this stack trace
C#
C++
Windows Phone-8
Access Violation
C++ read the whole file in buffer
C++
Raii
Using decltype to get an expression's type, without the const
C++
C++11
Decltype
c++ std::ostringstream vs std::string::append
C++
String
Stream
Why vector access operators are not specified as noexcept?
C++
Exception
C++11
Stl
Noexcept
Strange std::map behaviour
C++
Visual Studio-2012
G++
Named numbers as variables
C#
C++
Conventions
New to Xcode can't open files in c++?
C++
Xcode
Reference to non-static member function must be called
C++
Pointers
Reference
What is the difference between unordered_map::emplace and unordered_map::insert in C++?
C++
C++11
Insert
Unordered Map
Emplace
Syntax error with std::numeric_limits::max
C++
Visual C++
Syntax
Syntax Error
Numeric Limits
C++ cout auto separator
C++
Include )" in raw string literal without terminating said literal
C++
C++11
Delimiter
String Literals
Rawstring
How is "int main(){(([](){})());}" valid C++?
C++
C++11
Lambda
Syntax
Error "undefined reference to 'std::cout'"
C++
C++11
Gcc
Cout
Why do we not have a virtual constructor in C++?
C++
Constructor
Virtual Functions
Constructor initialization-list evaluation order
C++
Gcc
C++ Faq
How can I get the size of an std::vector as an int?
C++
Vector
Size
Constants
Unsigned Integer
Global variables joke
C++
Global Variables
Global
Protobuf: Will set_allocated_* delete the allocated object?
C++
Protocol Buffers
Multiple aliases for a namespace?
C++
Inline way to disable clang-tidy checks
C++
Clang++
Clang Tidy
C++ std::tuple order of destruction
C++
C++11
Std
Stdtuple
Reducing code duplication while defining a commutative operation
C++
Templates
Metaprogramming
Is there any reason to use std::map::emplace() instead of try_emplace() in C++1z?
C++
C++17
Do the padding bytes of a POD type get copied?
C++
Copy Constructor
In C++, what do braces on the left-hand side of a variable declaration mean?
C++
Is the "this" pointer just a compile time thing?
C++
Gcc
This
This Pointer
Tricky interview question for mid-level C++ developer
C++
Why is an overloaded function with two arguments of type double called when passing a long long?
C++
Double
Overloading
Overload Resolution
Segmentation fault when using a shared_ptr for private_key
C++
C++11
Segmentation Fault
Shared Ptr
Botan
When should you use a class vs a struct in C++?
C++
Oop
Class
Struct
Ooad
What do single quotes do in C++ when used on multiple characters?
C++
Quotes
How do I get the directory that a program is running from?
C++
C
Working Directory
For every character in string
C++
Loops
For Loop
Character
Why would I ever use push_back instead of emplace_back?
C++
C++11
Std
vector vs. list in STL
C++
List
Vector
Stl
How to parse a string to an int in C++?
C++
Parsing
What is the "assert" function?
C++
C
Assert
"unpacking" a tuple to call a matching function pointer
C++
Function Pointers
C++11
Variadic Templates
Iterable Unpacking
Why is f(i = -1, i = -1) undefined behavior?
C++
Language Lawyer
Undefined Behavior
What techniques can be used to speed up C++ compilation times?
C++
What is a "translation unit" in C++?
C++
Can you remove elements from a std::list while iterating through it?
C++
List
Std
Calling virtual functions inside constructors
C++
Constructor
Overriding
Virtual Functions
Is there a difference between copy initialization and direct initialization?
C++
Initialization
How to print (using cout) a number in binary form?
C++
Binary
Iostream
Representation
Std Bitset
How to write a large buffer into a binary file in C++, fast?
C++
Performance
Optimization
File Io
Io
What is the 'override' keyword in C++ used for?
C++
C++11
Overriding
Return array in a function
C++
Arrays
Pointers
Function
Return
What's the difference between __PRETTY_FUNCTION__, __FUNCTION__, __func__?
C++
C
Compiler Construction
Standards
Is there a difference between foo(void) and foo() in C++ or C?
C++
C
Arguments
How to convert QString to std::string?
C++
Qt
Type Conversion
Qstring
How do I add a linker or compile flag in a CMake file?
C++
Cmake
How to avoid "if" chains?
C++
C
If Statement
Control Flow
How to Detect if I'm Compiling Code with a particular Visual Studio version?
C++
Visual Studio
View array in Visual Studio debugger?
C++
Visual Studio
Arrays
View
Debugging
How to cast int to enum in C++?
C++
Casting
Enums
Pointer vs. Reference
C++
Variables
Pointers
Reference
Is there a Java equivalent or methodology for the typedef keyword in C++?
Java
C++
C
Design Patterns
Typedef
What are the most widely used C++ vector/matrix math/linear algebra libraries, and their cost and benefit tradeoffs?
C++
Math
Matrix
Linear Algebra
C++, What does the colon after a constructor mean?
C++
Is optimisation level -O3 dangerous in g++?
C++
Optimization
G++
Compiler Flags
Range based loop: get item by value or reference to const?
C++
C++11
Benefits of inline functions in C++?
C++
Inline Functions
What do 'statically linked' and 'dynamically linked' mean?
C#
C++
Linker
Static Linking
Dynamic Linking
What are the differences between .so and .dylib on macOS?
C++
C
Macos
Unix
What are POD types in C++?
C++
Types
C++ Faq
What is the difference between public, private, and protected inheritance in C++?
C++
Inheritance
Encapsulation
Access Specifier
C++ Faq
Can a local variable's memory be accessed outside its scope?
C++
Memory Management
Local Variables
Dangling Pointer
What is the difference between 'typedef' and 'using' in C++11?
C++
C++11
Typedef
Using Declaration
Why use iterators instead of array indices?
C++
For Loop
Stl
Iterator
Containers
C++ new int[0] -- will it allocate memory?
C++
Memory Management
New Operator
Standards Compliance
The static keyword and its various uses in C++
C++
Static
How to pass objects to functions in C++?
C++
Pointers
Pass by-Reference
Pass by-Value
C++ Faq
How does libuv compare to Boost/ASIO?
C++
Boost
Boost Asio
Libuv
Forward declaration of a typedef in C++
C++
Typedef
Forward Declaration
Significance of ios_base::sync_with_stdio(false); cin.tie(NULL);
C++
C
What does "default" mean after a class' function declaration?
C++
C++11
Default
Declaration
Keyword
to_string is not a member of std, says g++ (mingw)
C++
C++11
G++
Mingw
Tostring
Remove last character from C++ string
C++
String
Substring
Why can I not push_back a unique_ptr into a vector?
C++
Stl
C++11
Smart Pointers
Unique Ptr
What are forward declarations in C++?
C++
Declaration
Forward Declaration
What is the difference between "long", "long long", "long int", and "long long int" in C++?
C++
Long Integer
How to properly overload the << operator for an ostream?
C++
Namespaces
Operator Overloading
Iostream
Ostream
Autocompletion in Vim
C++
Vim
Ide
Autocomplete
C++ sorting and keeping track of indexes
C++
Sorting
Stl
Indexing
Can I set a breakpoint on 'memory access' in GDB?
C++
Debugging
Gdb
Breakpoints
Memory Access
Are there benefits of passing by pointer over passing by reference in C++?
C++
Pointers
Parameter Passing
Pass by-Reference
Why does volatile exist?
C++
Volatile
C++ Faq
What does {0} mean when initializing an object?
C++
C
What is the <=> ("spaceship", three-way comparison) operator in C++?
C++
Operators
C++ Faq
C++20
Spaceship Operator
Function passed as template argument
C++
Templates
Code Generation
Functor
What is "rvalue reference for *this"?
C++
C++11
Move Semantics
C++ Faq
Qualifiers
g++ undefined reference to typeinfo
C++
Linker
G++
Can lambda functions be templated?
C++
Templates
Lambda
C++11
Is "delete this" allowed in C++?
C++
Memory Management
New Operator
Delete Operator
Self Destruction
Count character occurrences in a string in C++
C++
String
Pattern Matching
Is the 'override' keyword just a check for a overridden virtual method?
C++
C++11
Overriding
Virtual Functions
C++ Faq
Do the parentheses after the type name make a difference with new?
C++
Constructor
Initialization
New Operator
C++ Faq
Can I call a constructor from another constructor (do constructor chaining) in C++?
C++
Constructor
What is the difference between g++ and gcc?
C++
Gcc
G++
Why should I prefer to use member initialization lists?
C++
Oop
Object Construction
When does a process get SIGABRT (signal 6)?
C++
Sigabrt
What is the difference between static_cast<> and C style casting?
C++
Casting
Static Cast
C++ "virtual" keyword for functions in derived classes. Is it necessary?
C++
Overriding
Virtual Functions
What is the best open XML parser for C++?
C++
Xml
Open Source
Does static constexpr variable inside a function make sense?
C++
Static
C++11
Constexpr
(-2147483648> 0) returns true in C++?
C++
Types
Literals
Integer Overflow
Remove spaces from std::string in C++
C++
String
Stl
Whitespace
round() for float in C++
C++
Floating Point
Rounding
Is it a good practice to place C++ definitions in header files?
C++
Coding Style
Code Separation
How much is too much with C++11 auto keyword?
C++
Types
C++11
Type Inference
Auto
insert vs emplace vs operator[] in c++ map
C++
Dictionary
Insert
Operators
Emplace
std::lock_guard or std::scoped_lock?
C++
Multithreading
Locking
C++17
Is the sizeof(some pointer) always equal to four?
C++
C
Pointers
Memory
Sizeof
static const vs #define
C++
C
Constants
Single quotes vs. double quotes in C or C++
C++
C
Syntax
Char
String Literals
What is memory fragmentation?
C++
Memory
Heap Memory
Fragmentation
Why is transposing a matrix of 512x512 much slower than transposing a matrix of 513x513?
C++
Performance
Optimization
Why is unsigned integer overflow defined behavior but signed integer overflow isn't?
C++
C
Undefined Behavior
Integer Overflow
When to use std::size_t?
C++
Types
Idioms
Size T
Loop Counter
Is it possible to use std::string in a constexpr?
C++
C++11
Constexpr
Stdstring
How do I make CMake output into a 'bin' dir?
C++
Plugins
Cmake
std::unique_ptr with an incomplete type won't compile
C++
Unique Ptr
Incomplete Type
Libc++
Using arrays or std::vectors in C++, what's the performance gap?
C++
Arrays
Vector
How come a non-const reference cannot bind to a temporary object?
C++
Reference
Constants
Temporary
C++ Faq
Why does an overridden function in the derived class hide other overloads of the base class?
C++
Polymorphism
Overriding
Why can't variables be declared in a switch statement?
C++
Switch Statement
Undefined behavior and sequence points
C++
Undefined Behavior
C++ Faq
Sequence Points
How to convert a std::string to const char* or char*
C++
String
Char
Constants
How to convert wstring into string?
C++
Unicode
Stl
Wstring
How do you properly use namespaces in C++?
C++
Namespaces
cout is not a member of std
C++
Io
Std
Member
Cout
How do I convert between big-endian and little-endian values in C++?
C++
Endianness
What exactly is a reentrant function?
C++
C
Recursion
Thread Safety
Reentrancy
What is the best way to use a HashMap in C++?
C++
Hashmap
Why do function pointer definitions work with any number of ampersands '&' or asterisks '*'?
C++
C
Function Pointers
Which kind of pointer do I use when?
C++
Pointers
C++11
Smart Pointers
C++ Faq
What exactly is std::atomic?
C++
Multithreading
C++11
Atomic
Can the use of C++11's 'auto' improve performance?
C++
Performance
C++11
Auto
Are memory leaks ever ok?
C++
C
Memory Leaks
C++ display stack trace on exception
C++
Exception
Exception Handling
Stack Trace
Why do I have to access template base class members through the this pointer?
C++
Templates
Inheritance
C++ Faq
std::vector performance regression when enabling C++11
C++
Performance
Gcc
C++11
Vector
Do I need to manually close an ifstream?
C++
Ifstream
Raii
How to remove from a map while iterating it?
C++
Map
C++11
How to use enums in C++
C++
Enums
Iterate through a C++ Vector using a 'for' loop
C++
Coding Style
For Loop
Iterator
How do I read an entire file into a std::string in C++?
C++
String
File Io
When to use inline function and when not to use it?
C++
C
Inline
Fastest way to reset every value of std::vector<int> to 0
C++
Reset
Stdvector
Why can't my program compile under Windows 7 in French?
C++
Visual Studio-2013
French
What's the best free C++ profiler for Windows?
C++
Windows
Profile
Interview question: Check if one string is a rotation of other string
Java
C++
C
Is std::vector so much slower than plain arrays?
C++
Arrays
Performance
Stl
Vector
What is std::decay and when it should be used?
C++
C++11
Standard Library
Should I use static_cast or reinterpret_cast when casting a void* to whatever
C++
Pointers
Static Cast
Reinterpret Cast
What is the difference between _tmain() and main() in C++?
C++
Unicode
Arguments
What are some better ways to avoid the do-while(0); hack in C++?
C++
Do While
Difference between a virtual function and a pure virtual function
C++
Function
Pure Virtual
Replace part of a string with another string
C++
String
Replace
Substring
Std
Passing an array by reference
C++
Arrays
What is the correct way of using C++11's range-based for?
C++
C++11
Foreach
push_back vs emplace_back
C++
Visual Studio-2010
Stl
C++11
Move Semantics
What are the rules about using an underscore in a C++ identifier?
C++
Naming Conventions
Standards
C++ Faq
What are the new features in C++17?
C++
Standards
C++ Faq
C++17
What are C++ functors and their uses?
C++
Functor
Function Object
Function Call-Operator
What breaking changes are introduced in C++11?
C++
C++11
smart pointers (boost) explained
C++
Boost
Smart Pointers
Forward declaration of nested types/classes in C++
C++
Class
Nested
Forward Declaration
What to do about a 11000 lines C++ source file?
C++
Version Control
Maintenance
Anti Patterns
Why is conversion from string constant to 'char*' valid in C but invalid in C++
C++
C
String
C++11
Char
Is there a way to simulate the C++ 'friend' concept in Java?
Java
C++
Friend
Accessor
How to use enums as flags in C++?
C++
Enums
What is stack unwinding?
C++
Stack
How to turn on (literally) ALL of GCC's warnings?
C++
Gcc
Warnings
Compiler Warnings
Gcc Warning
Is it better in C++ to pass by value or pass by constant reference?
C++
Variables
Pass by-Reference
Constants
Pass by-Value
C++ STL Vectors: Get iterator from index?
C++
Stl
Vector
Iterator
Detecting endianness programmatically in a C++ program
C++
Algorithm
Endianness
C++ equivalent of StringBuffer/StringBuilder?
C++
Stl
String Concatenation
How do I print the elements of a C++ vector in GDB?
C++
Debugging
Stl
Vector
Gdb
Are members of a C++ struct initialized to 0 by default?
C++
Post-increment and pre-increment within a 'for' loop produce same output
C++
C
For Loop
Operator Precedence
What really is a deque in STL?
C++
Stl
Deque
Is local static variable initialization thread-safe in C++11?
C++
Thread Safety
C++11
How to automatically convert strongly typed enum into int?
C++
C++11
Strongly Typed-Enum
Remove secure warnings (_CRT_SECURE_NO_WARNINGS) from projects by default in Visual Studio
C++
Visual Studio
Precompiler
Undefined reference to static constexpr char[]
C++
C++11
Static Members
Constexpr
Using "super" in C++
C++
Coding Style
Finding current executable's path without /proc/self/exe
C++
C
Linux
Macos
Executable
make_unique and perfect forwarding
C++
C++11
Variadic Templates
Unique Ptr
Perfect Forwarding
Can't use modulus on doubles?
C++
Modulo
How to generate a random number in C++?
C++
Random
mmap() vs. reading blocks
C++
File Io
Fstream
Mmap
Accessing an array out of bounds gives no error, why?
C++
Arrays
What is the best way to concatenate two vectors?
C++
Vector
What is the curiously recurring template pattern (CRTP)?
C++
Templates
C++ Faq
Crtp
What is the point of noreturn?
C++
C++11
Attributes
Noreturn
Is there a C++ gdb GUI for Linux?
C++
Linux
Gdb
Debugging
Why is it wrong to use std::auto_ptr<> with standard containers?
C++
Stl
Raii
Auto Ptr
C++ Faq
How can I declare and define multiple variables in one line using C++?
C++
Using generic std::function objects with member functions in one class
C++
Function
Function Pointers
C++11
Tr1
What does T&& (double ampersand) mean in C++11?
C++
C++11
Rvalue Reference
C++ Faq
Perfect Forwarding
Why should C++ programmers minimize use of 'new'?
C++
Memory Management
Heap Memory
New Operator
C++ Faq
How to trim a std::string?
C++
Trim
Stdstring
Compare double to zero using epsilon
C++
Floating Point
Double
Why would one use nested classes in C++?
C++
Nested
Inner Classes
C++ equivalent of java's instanceof
Java
C++
Oop
Instanceof
Why is the C++ STL is so heavily based on templates? (and not on *interfaces*)
C++
Oop
Templates
Stl
How do I call ::std::make_shared on a class with only protected or private constructors?
C++
C++11
Shared Ptr
How is "=default" different from "{}" for default constructor and destructor?
C++
C++11
User Defined-Functions
Default Constructor
Deleted Functions
Why does this if-statement combining assignment and an equality check return true?
C++
If Statement
How do I see a C/C++ source file after preprocessing in Visual Studio?
C++
C
Debugging
Visual Studio-2005
C Preprocessor
How to append text to a text file in C++?
C++
Filestream
Thou shalt not inherit from std::vector
C++
Oop
Inheritance
Stl
Vector
Default constructor with empty brackets
C++
Constructor
Default Constructor
C++ Faq
Most Vexing-Parse
Why does C# not provide the C++ style 'friend' keyword?
C#
C++
Design Patterns
Oop
Friend
Capture characters from standard input without waiting for enter to be pressed
C++
C
Inputstream
How to call erase with a reverse iterator
C++
What is the purpose of std::make_pair vs the constructor of std::pair?
C++
Stl
Std Pair
return statement vs exit() in main()
C++
C
Coding Style
Return
Exit
Throw keyword in function's signature
C++
Exception
How to append a char to a std::string?
C++
String
Can I use a binary literal in C or C++?
C++
C
Binary
How to pass arguments and redirect stdin from a file to program run in gdb?
C++
Debugging
Gdb
How to find memory leak in a C++ code/project?
C++
Memory Leaks
Protecting executable from reverse engineering?
C++
C
Obfuscation
Assembly
Using G++ to compile multiple .cpp and .h files
C++
Compilation
Header
Makefile
What are the errors, misconceptions or bad pieces of advice given by cplusplus.com?
C++
Which is the fastest algorithm to find prime numbers?
C++
Algorithm
Primes
What is the difference between conversion specifiers %i and %d in formatted IO functions (*printf / *scanf)
C++
C
Printf
Scanf
Format Specifiers
Why is std::map implemented as a red-black tree?
C++
Dictionary
Data Structures
Stl
Binary Search-Tree
Why use non-member begin and end functions in C++11?
C++
C++11
Stl
Iterator
Container Data-Type
How to enable C++11/C++0x support in Eclipse CDT?
C++
Eclipse
C++11
Eclipse Cdt
Unresolved external symbol in object files
C++
Visual Studio
Visual C++
Unresolved External
What is the use of having destructor as private?
C++
Private
Destructor
Return type of '?:' (ternary conditional operator)
C++
Types
Reference
Conditional Operator
Lvalue
libpng warning: iCCP: known incorrect sRGB profile
C++
Warnings
Sdl
Rgb
Libpng
What does the restrict keyword mean in C++?
C++
Restrict Qualifier
How to convert an instance of std::string to lower case
C++
String
C++ Standard-Library
Tolower
What is the strict aliasing rule?
C++
C
Undefined Behavior
Strict Aliasing
Type Punning
Difference between 'struct' and 'typedef struct' in C++?
C++
Struct
Typedef
What does the 'L' in front a string mean in C++?
C++
Separating class code into a header and cpp file
C++
Oop
Class
Struct inheritance in C++
C++
Inheritance
Struct
How to stop C++ console application from exiting immediately?
C++
Console
Exit
Terminate
C++ Faq
Can a C++ enum class have methods?
C++
Methods
Enums
How does a language expand itself?
C++
Libraries
Bootstrapping
Undefined reference to static class member
C++
G++
Parsing Command Line Arguments in C++?
C++
Command Line-Arguments
How to initialize a vector in C++
C++
Arrays
Vector
Declaration
Why are Standard iterator ranges [begin, end) instead of [begin, end]?
C++
Stl
Iterator
Standards
What is string_view?
C++
C++17
String View
Fundamentals Ts
Can modern C++ get you performance for free?
C++
Performance
C++11
Move Semantics
C++14
What is the reason behind cbegin/cend?
C++
C++11
Iterator
Const Correctness
Const Iterator
What does auto&& tell us?
C++
C++11
Auto
Forwarding Reference
C++ IDE for Linux?
C++
Linux
Ide
Why are two different concepts both called "heap"?
C++
Heap
Terminology
Heap Memory
Is assert evil?
C++
C
Error Handling
Go
Assert
In STL maps, is it better to use map::insert than []?
C++
Dictionary
Stl
Insert
Stdmap
Is there a replacement for unistd.h for Windows (Visual C)?
C++
C
Windows
Portability
unistd.h
How to initialize std::vector from C-style array?
C++
Arrays
Vector
Stl
Determine the line of code that causes a segmentation fault?
C++
C
Debugging
Segmentation Fault
How to get started with developing Internet Explorer extensions?
C#
C++
Internet Explorer
Atl
Browser Extension
Does the C++ standard mandate poor performance for iostreams, or am I just dealing with a poor implementation?
C++
Performance
Iostream
What do the following phrases mean in C++: zero-, default- and value-initialization?
C++
Initialization
C++ Faq
Is std::vector copying the objects with a push_back?
C++
Stl
Stdvector
C++ Convert string (or char*) to wstring (or wchar_t*)
C++
String
Wstring
Why does C++ code for testing the Collatz conjecture run faster than hand-written assembly?
C++
Performance
Assembly
Optimization
X86
What is std::move(), and when should it be used?
C++
C++11
Move Semantics
C++ Faq
Stdmove
Where are static variables stored in C and C++?
C++
C
Compiler Construction
Why do you use typedef when declaring an enum in C++?
C++
Enums
Typedef
How do I create a random alpha-numeric string in C++?
C++
String
Random
In which scenario do I use a particular STL container?
C++
Stl
Container Data-Type
How to add a 'or' condition in #ifdef
C++
C
C Preprocessor
Lambda capture as const reference?
C++
C++11
Lambda
C++14
C++ compiling on Windows and Linux: ifdef switch
C++
Linux
Windows
Conditional Compilation
Ifdefine
Unnecessary curly braces in C++?
C++
Code Formatting
What are the differences between Generics in C# and Java... and Templates in C++?
C#
Java
C++
Generics
Templates
std::auto_ptr to std::unique_ptr
C++
C++11
Smart Pointers
Auto Ptr
Unique Ptr
How do I typedef a function pointer with the C++11 using syntax?
C++
C++11
Typedef
Do you use NULL or 0 (zero) for pointers in C++?
C++
Null
What is the difference between atan and atan2 in C++?
C++
math.h
RAII and smart pointers in C++
C++
Smart Pointers
Raii
How to use C++ in Go
C++
Wrapper
Go
Throwing the fattest people off of an overloaded airplane.
C++
Algorithm
Sorting
Stl
How do I get the type of a variable?
C++
Variables
Typeof
How do I install g++ for Fedora?
C++
Linux
G++
Fedora
Dnf
Measuring execution time of a function in C++
C++
Optimization
Profiling
Is there a max array length limit in C++?
C++
Arrays
What are all the common undefined behaviours that a C++ programmer should know about?
C++
Undefined
Undefined Behavior
C++ Faq
C state-machine design
C++
C
Architecture
State Machine
Pure virtual function with implementation
C++
Pure Virtual
Is there a technical reason to use > (<) instead of != when incrementing by 1 in a 'for' loop?
C++
C
For Loop
What is the difference between include_directories and target_include_directories in CMake?
C++
Cmake
Convert Python program to C/C++ code?
C++
Python
C
Code Generation
Disable copy constructor
C++
Copy Constructor
c++11 Return value optimization or move?
C++
C++11
Move
Return Value-Optimization
Rvo
How to build and use Google TensorFlow C++ api
C++
Tensorflow
What is wrong with using goto?
C++
Goto
C++ Double Address Operator? (&&)
C++
Stl
Operator Keyword
Memory Address
Mutex example / tutorial?
C++
C
Multithreading
Synchronization
Mutex
What are the differences between a pointer variable and a reference variable in C++?
C++
Pointers
Reference
C++ Faq
What does the explicit keyword mean?
C++
Constructor
Explicit
C++ Faq
Explicit Constructor
How do I iterate over the words of a string?
C++
String
Split
Why is "using namespace std;" considered bad practice?
C++
Namespaces
Std
Using Directives
C++ Faq
Why use apparently meaningless do-while and if-else statements in macros?
C++
C
C Preprocessor
C++ Faq
Concatenating two std::vectors
C++
Vector
Stl
Concatenation
Stdvector
How do you declare an interface in C++?
C++
Inheritance
Interface
Abstract Class
Pure Virtual
public friend swap member function
C++
C++11
Friend
Copy and-Swap
Why is 'this' a pointer and not a reference?
C++
Pointers
Reference
This
C++ Faq
Which Boost features overlap with C++11?
C++
Boost
C++11
What is &&& operation in C
C++
C
Operators
Compiler Optimization
Gcc Warning
How do I clear the std::queue efficiently?
C++
Data Structures
Stl
Queue
Default template arguments for function templates
C++
Templates
Rounding up to the nearest multiple of a number
C++
Algorithm
Rounding
Is it better to use std::memcpy() or std::copy() in terms to performance?
C++
Performance
Optimization
Implicit type conversion rules in C++ operators
C++
Casting
Implicit
When vectors are allocated, do they use memory on the heap or the stack?
C++
Vector
Stl
Heap Memory
Stack Memory
How are GCC and g++ bootstrapped?
C++
C
Compiler Construction
Is inline assembly language slower than native C++ code?
C++
C
Performance
Assembly
"No newline at end of file" compiler warning
C++
Compiler Construction
Warnings
C Preprocessor
What's the difference between size_t and int in C++?
C++
C
Types
Int
Compelling examples of custom C++ allocators?
C++
Memory Management
Std
Memory Alignment
Allocator
STL or Qt containers?
C++
Qt
Stl
std::cin input with spaces?
C++
String
User Input
Space
Cin
What is "Argument-Dependent Lookup" (aka ADL, or "Koenig Lookup")?
C++
Argument Dependent-Lookup
Name Lookup
C++ Faq
Which C++ idioms are deprecated in C++11?
C++
C++11
C++ Faq
What is the effect of ordering if...else if statements by probability?
C++
Performance
If Statement
Optimization
Branch Prediction
What made i = i++ + 1; legal in C++17?
C++
Language Lawyer
C++17
What modern C++ libraries should be in my toolbox?
C++
maximum value of int
C++
C
Stl
Limits
Numeric Limits
Template default arguments
C++
Templates
shared_ptr to an array : should it be used?
C++
C++11
Shared Ptr
Why does std::list::reverse have O(n) complexity?
C++
C++11
Stl
Linked List
Why do we require requires requires?
C++
C++ Concepts
C++20
How do you append an int to a string in C++?
C++
Int
Stdstring
How do you install Boost on MacOS?
C++
Macos
Boost
std::wstring VS std::string
C++
String
Unicode
C++ Faq
Wstring
C++ Singleton design pattern
C++
Design Patterns
Singleton
What is object slicing?
C++
Inheritance
C++ Faq
Object Slicing
What is the logic behind the "using" keyword in C++?
C++
C++11
How do I convert a double into a string in C++?
C++
String
Double
Programmatically get the cache line size?
C++
C
Caching
Operating System
Systems Programming
How to initialise memory with new operator in C++?
C++
Initialization
Memory Management
New Operator
Does the default constructor initialize built-in types?
C++
Constructor
Initialization
Default Constructor
Built in-Types
pinpointing "conditional jump or move depends on uninitialized value(s)" valgrind message
C++
Valgrind
printf with std::string?
C++
String
Namespaces
Printf
Std
uint8_t can't be printed with cout
C++
Cout
Unsigned Char
Uint8t
Recursive lambda functions in C++11
C++
C++11
Lambda
Static variables in member functions
C++
Static
Scope
C++ auto keyword. Why is it magic?
C++
Types
C++11
Auto
Can I use if (pointer) instead of if (pointer != NULL)?
C++
Pointers
If Statement
Null
Null Pointer
Are inline virtual functions really a non-sense?
C++
Inline
Virtual Functions
Internal typedefs in C++ - good style or bad style?
C++
Coding Style
Typedef
'typeid' versus 'typeof' in C++
C++
Typeof
Typeid
How do C++ class members get initialized if I don't do it explicitly?
C++
Initialization
Member Initialization
Can virtual functions have default parameters?
C++
C++11
C++03
How do I reverse a C++ vector?
C++
Vector
Stl
Std
Why can lambdas be better optimized by the compiler than plain functions?
C++
Optimization
C++11
Lambda
Compiler Optimization
How well is Unicode supported in C++11?
C++
Unicode
C++11
How to create a shared library with cmake?
C++
Compilation
Cmake
Shared Libraries
Compiling with g++ using multiple cores
C++
Compiler Construction
Makefile
G++
Multicore
Advantages of std::for_each over for loop
C++
Stl
Foreach
Coding Style
Does a const reference class member prolong the life of a temporary?
C++
Temporary
Ctor Initializer
Const Reference
How to "return an object" in C++?
C++
Reference
Performance
Return
Move capture in lambda
C++
Lambda
C++11
Rvalue Reference
OpenCV C++/Obj-C: Detecting a sheet of paper / Square Detection
C++
Objective C
Image Processing
Opencv
Computer Vision
"Undefined reference to" template class constructor
C++
Templates
Compiler Errors
Codeblocks
fork() branches more than expected?
C++
C
Fork
How does the Comma Operator work
C++
Comma Operator
How do you reverse a string in place in C or C++?
C++
C
String
Reverse
Is the order of iterating through std::map known (and guaranteed by the standard)?
C++
Dictionary
Stl
Standards
Arrow operator (->) in function heading
C++
C++11
Auto
Decltype
How do I forward declare an inner class?
C++
Forward Declaration
static constructors in C++? I need to initialize private static objects
C++
Static
Private
Initializer
Static Constructor
Rotating a point about another point (2D)
C++
Algorithm
Modulo operator with negative values
C++
In CMake, how can I test if the compiler is Clang?
C++
C
Cmake
Clang
What is a "cache-friendly" code?
C++
Performance
Caching
Memory
Cpu Cache
Meaning of 'const' last in a function declaration of a class?
C++
Constants
Declaration
C++ Faq
What is the idiomatic way in CMAKE to add the -fPIC compiler option?
C++
C
Cmake
Is there still a reason to use `int` in C++ code?
C++
Does C++11, 14, 17 or 20 introduce a standard constant for pi?
C++
C++11
C++14
Language Lawyer
C++17
C++ Dynamic Shared Library on Linux
C++
Linux
Shared Libraries
C++ templates that accept only certain types
C++
Templates
Checking for NULL pointer in C/C++
C++
C
If Statement
Null
Coding Style
Why is a boolean 1 byte and not 1 bit of size?
C++
Boolean
Byte
Cpu Architecture
Abi
Choice between vector::resize() and vector::reserve()
C++
Vector
What are some uses of decltype(auto)?
C++
Auto
C++14
Decltype
Return Type-Deduction
Why would I std::move an std::shared_ptr?
C++
C++11
Shared Ptr
Smart Pointers
Move Semantics
__FILE__, __LINE__, and __FUNCTION__ usage in C++
C++
Debugging
Logging
C Preprocessor
Why does C++ need a separate header file?
C++
Language Design
Converting an int to std::string
C++
String
Int
What happens when a computer program runs?
C++
Memory
Operating System
X86
Computer Architecture
What's the difference between std::move and std::forward
C++
C++11
Perfect Forwarding
When are C++ macros beneficial?
C++
C Preprocessor
C++ blogs that you regularly follow?
C++
Blogs
Why is it considered a bad practice to omit curly braces?
Java
C#
C++
C
Coding Style
Why is a C++ Vector called a Vector?
C++
Stl
Vector
Linux c++ error: undefined reference to 'dlopen'
C++
Linux
Eclipse
Why would anyone use set instead of unordered_set?
C++
Algorithm
Data Structures
C++11
What's the difference between istringstream, ostringstream and stringstream? / Why not use stringstream in every case?
C++
String
Stringstream
Ostringstream
Istringstream
C++ inheritance - inaccessible base?
C++
Inheritance
Is the safe-bool idiom obsolete in C++11?
C++
C++11
Deprecated
C++ Faq
Safe Bool-Idiom
Clang vs GCC for my Linux Development project
C++
C
Linux
Gcc
Clang
Tool to track #include dependencies
C++
C
Header
How to fix .pch file missing on build?
C++
Visual Studio
Precompiled Headers
Pch
Using member variable in lambda capture list inside a member function
C++
Visual Studio-2010
Lambda
C++11
What does (x ^ 0x1) != 0 mean?
C++
C
Bit Manipulation
Bitmask
What does "Memory allocated at compile time" really mean?
C++
C
Memory
Memory Management
Terminology
Displaying the #include hierarchy for a C++ file in Visual Studio
C++
Visual Studio
Include
Should I add .vcxproj.filter files to source control?
C++
Visual Studio-2010
Visual Studio
Version Control
Visual C++-2010
Deleting elements from std::set while iterating
C++
Iterator
Set
Std
C++ Standard-Library
What does "#pragma comment" mean?
C++
Visual C++
Macros
Pragma
How to print to console when using Qt
C++
Qt
Cout
std::enable_if to conditionally compile a member function
C++
Templates
G++
C++11
Advantage of switch over if-else statement
C++
If Statement
Optimization
Switch Statement
Is "for(;;)" faster than "while (true)"? If not, why do people use it?
C++
C
Optimization
Readability
Infinite Loop
C++: const reference, before vs after type-specifier
C++
Reference
Constants
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
C++
C
Struct
Sizeof
C++ Faq
What should main() return in C and C++?
C++
C
Return Value
Main
Return Type
What are the rules for calling the base class constructor?
C++
Inheritance
Constructor
The program can't start because libgcc_s_dw2-1.dll is missing
C++
Windows
Mingw
Printing the correct number of decimal points with cout
C++
Meaning of acronym SSO in the context of std::string
C++
String
Optimization
The new syntax "= default" in C++11
C++
C++11
How different is Objective-C from C++?
C++
Objective C
What is Objective C++?
C++
Objective C
Xcode
Objective C++
Integer to hex string in C++
C++
Decimal
Hex
Int
What does iterator->second mean?
C++
Stl
Iterator
Can I hint the optimizer by giving the range of an integer?
C++
Optimization
Integer
Range
Compiler Optimization
C++ valarray vs. vector
C++
Stl
Stdvector
C++ Standard-Library
Valarray
How to change string into QString?
C++
String
Qt
Qstring
What is __declspec and when do I need to use it?
C++
Static member initialization in a class template
C++
Templates
Static
How can I get the maximum or minimum value in a vector?
C++
Vector
Max
Min
CMake: Project structure with unit tests
C++
Unit Testing
Boost
Cmake
Boost Test
What happens to a detached thread when main() exits?
C++
Multithreading
C++11
Exit
Stdthread
What are the complexity guarantees of the standard containers?
C++
Stl
Containers
Big O
Why should I avoid multiple inheritance in C++?
C++
Oop
Multiple Inheritance
C++ cout hex values?
C++
Hex
Cout
In C++, what is a "namespace alias"?
C++
Namespaces
Generating random integer from a range
C++
Random
Fastest method of screen capturing on Windows
C++
C
Windows
Thread pooling in C++11
C++
Multithreading
C++11
Threadpool
Stdthread
What is the worst real-world macros/pre-processor abuse you've ever come across?
C++
C
Macros
Preprocessor
What does void mean in C, C++, and C#?
C#
C++
C
Language Design
Terminology
Why does flowing off the end of a non-void function without returning a value not produce a compiler error?
C++
C
Gcc
G++
How to sort with a lambda?
C++
Sorting
Lambda
Char
Constants
Is the PIMPL idiom really used in practice?
C++
Oop
Pimpl Idiom
std::function vs template
C++
Templates
C++11
Std Function
What's this =! operator?
C++
C
Operators
Stack, Static, and Heap in C++
C++
Static
Garbage Collection
Stack
Heap Memory
Why is volatile not considered useful in multithreaded C or C++ programming?
C++
C
Multithreading
Volatile
C++ Faq
Naming convention - underscore in C++ and C# variables
C#
C++
Naming Conventions
What does iota of std::iota stand for?
C++
Naming Conventions
C++11
C++11 std::threads vs posix threads
C++
Multithreading
C++11
Pthreads
Why should I avoid std::enable_if in function signatures
C++
Templates
C++11
Sfinae
Enable If
Why is my program slow when looping over exactly 8192 elements?
C++
Performance
Memory Management
Gcc
What is a segmentation fault?
C++
C
Segmentation Fault
Appending a vector to a vector
C++
Stl
Vector
How to get current timestamp in milliseconds since 1970 just the way Java gets
C++
Timestamp
Isn't a semicolon (';') needed after a function declaration in C++?
C++
Function
Syntax
Declaration
How do you exit from a void function in C++?
C++
How to debug heap corruption errors?
C++
Windows
Debugging
Heap Corruption
In c++ what does a tilde "~" before a function name signify?
C++
What do linkers do?
C++
Linker
Dynamic Linking
Relocation
Const before or const after?
C++
C
Syntax
Constants
How to get std::vector pointer to the raw data?
C++
Stl
Vector
How to enable C++17 compiling in Visual Studio?
C++
Visual Studio
Compilation
C++17
How to use the C socket API in C++ on z/OS
C++
C
Sockets
Mainframe
Zos
dynamic_cast and static_cast in C++
C++
Casting
Dynamic Cast
delete vs delete[] operators in C++
C++
Memory Management
Delete Operator
How can I reliably get an object's address when operator& is overloaded?
C++
C++11
Operator Overloading
Memory Address
How to cast/convert pointer to reference in C++
C++
Pointers
Casting
Reference
Type Conversion
Using smart pointers for class members
C++
C++11
Shared Ptr
Smart Pointers
Unique Ptr
A fast method to round a double to a 32-bit int explained
C++
C
Performance
Floating Point
When should I use std::thread::detach?
C++
C++11
Stdthread
Can num++ be atomic for 'int num'?
C++
C
Multithreading
Assembly
Atomic
Why should I declare a virtual destructor for an abstract class in C++?
C++
Inheritance
Virtual Destructor
How do I concatenate multiple C++ strings on one line?
C++
String
Compiler Errors
Concatenation
One Liner
What is the C++ function to raise a number to a power?
C++
Math
How to get the error message from the error code returned by GetLastError()?
C++
C
Winapi
Why should I not include cpp files and instead use a header?
C++
Header Files
Is it good practice to NULL a pointer after deleting it?
C++
Pointers
Null
Dynamic Allocation
How to determine the version of the C++ standard used by the compiler?
C++
Standards
How to check if std::map contains a key without doing insert?
C++
Stl
Map
What is the type of lambda when deduced with "auto" in C++11?
C++
Lambda
C++11
Typeof
Auto
What is a C++ delegate?
C++
Delegates
Delegation
How to redirect cin and cout to files?
C++
How to enable C++11 in Qt Creator?
C++
Qt
C++11
Should I pass an std::function by const-reference?
C++
Function
Reference
Should I use std::function or a function pointer in C++?
C++
Function
C++11
Callback
Std
An expensive jump with GCC 5.4.0
C++
Gcc
X86
Conditional Statements
Branch Prediction
In C++, am I paying for what I am not eating?
C++
C
Finding the type of an object in C++
C++
Types
Pure virtual destructor in C++
C++
Polymorphism
Destructor
Pure Virtual
Why use prefixes on member variables in C++ classes
C++
Coding Style
Naming Conventions
Is Meyers' implementation of the Singleton pattern thread safe?
C++
Multithreading
Design Patterns
java.lang.ClassNotFoundException: Didn't find class on path: dexpathlist
Java
Android
C++
Android Ndk
What are the performance implications of using an immediate-mode GUI compared to a retained-mode GUI?
C++
Performance
User Interface
Desktop Application
Immediate Mode
C++ deprecated conversion from string constant to 'char*'
C++
String
Explicit Constructor
C++ equivalent of Java's toString?
C++
Declaring an enum within a class
C++
Class
Enums
Namespaces
Scope
Do you debug C++ code in Vim? How?
C++
Debugging
Vim
Gdb
What are the advantages of using nullptr?
C++
C++11
Null
C++ Faq
Nullptr
What's the difference between constexpr and const?
C++
C++11
Constants
Constexpr
Why use static_cast<int>(x) instead of (int)x?
C++
Casting
Static Cast
Sleep for milliseconds
C++
Linux
Sleep
How do inline variables work?
C++
C++17
Does delete on a pointer to a subclass call the base class destructor?
C++
Memory Management
Destructor
Delete Operator
Base Class
How to create a template function within a class? (C++)
C++
Templates
Function
Class
Why do we need a pure virtual destructor in C++?
C++
Destructor
Pure Virtual
What's the point of g++ -Wreorder?
C++
G++
Compiler Warnings
Why can't I forward-declare a class in a namespace using double colons?
C++
Namespaces
Calling constructors in c++ without new
C++
What are the GCC default include directories?
C++
C
Linux
Gcc
Include Path
Difference between size_t and std::size_t
C++
Size T
What is this crazy C++11 syntax ==> struct : bar {} foo {};?
C++
C++11
What is the purpose of the "final" keyword in C++11 for functions?
C++
C++11
Final
How does `void_t` work
C++
Templates
C++14
Sfinae
Checking if a folder exists (and creating folders) in Qt, C++
C++
Qt
Filesystems
Explain Morris inorder tree traversal without using stacks or recursion
C++
Binary Tree
Tree Traversal
Exotic architectures the standards committees care about
C++
C
Architecture
Static member functions error; How to properly write the signature?
C++
Static Members
Method Signature
Static Functions
How to run specific test cases in GoogleTest
C++
Visual Studio-2010
Googletest
TensorFlow, why was python the chosen language?
Python
C++
Machine Learning
Tensorflow
Should I use virtual, override, or both keywords?
C++
C++11
What is the difference between const_iterator and non-const iterator in the C++ STL?
C++
Stl
Iterator
Constants
How expensive is RTTI?
C++
Performance
Rtti
Is it more efficient to copy a vector by reserving and copying, or by creating and swapping?
C++
Algorithm
Vector
Stl
Is there any overhead to declaring a variable within a loop? (C++)
C++
Loops
Variable Declaration
Friend declaration in C++ - difference between public and private
C++
Private
Friend
Public
Why does the default parameterless constructor go away when you create one with parameters
C#
Java
C++
Default Constructor
What happens if you static_cast invalid value to enum class?
C++
Language Lawyer
Differences between std::make_unique and std::unique_ptr with new
C++
C++11
C++14
Smart Pointers
Unique Ptr
Advantages of pass-by-value and std::move over pass-by-reference
C++
If I copy a float to another variable, will they be equal?
C++
Floating Point
What are the differences between "generic" types in C++ and Java?
Java
C++
Generics
Templates
Language Features
Why are arrays of references illegal?
C++
Arrays
Reference
Is there a working C++ refactoring tool?
C++
Refactoring
C++ error: undefined reference to 'clock_gettime' and 'clock_settime'
C++
Linux
Ubuntu
Posix
time.h
C++: variable 'std::ifstream ifs' has initializer but incomplete type
C++
Fstream
Return Type
Why does this loop produce "warning: iteration 3u invokes undefined behavior" and output more than 4 lines?
C++
Gcc
Undefined Behavior
Should I store entire objects, or pointers to objects in containers?
C++
Stl
Pointers
Is D a credible alternative to Java and C++?
Java
C++
C
D
How can I compile and run C/C++ code in a Unix console or Mac terminal?
C++
C
Macos
Console
Terminal
Using custom std::set comparator
C++
Stl
How to concatenate a std::string and an int
C++
Integer
Concatenation
Stdstring
How to find out if an item is present in a std::vector?
C++
Vector
Std
What does the C++ standard state the size of int, long type to be?
C++
C++ Faq
What is difference between sjlj vs dwarf vs seh?
C++
Compiler Construction
Mingw
Cpu Architecture
Mingw W64
How do I use a custom deleter with a std::unique_ptr member?
C++
C++11
Move Semantics
Unique Ptr
Officially, what is typename for?
C++
Templates
Significance of -pthread flag when compiling
C++
C
Linux
Pthreads
std::function and std::bind: what are they, and when should they be used?
C++
C++11
Std Function
Stdbind
Never seen before C++ for loop
C#
C++
For Loop
Extracting text OpenCV
C++
Opencv
Image Processing
Text
Bounding Box
In Stroustrup's example, what does the colon mean in "return 1 : 2"?
C++
Syntax
Is short-circuiting logical operators mandated? And evaluation order?
C++
C
Logical Operators
Short Circuiting
Operator Precedence
while (1) Vs. for (;;) Is there a speed difference?
C++
Perl
Optimization
Performance
C++ static virtual members?
C++
Static
Virtual
Why is a pure virtual function initialized by 0?
C++
Abstract Class
Pure Virtual
C++ semantics of `static const` vs `const`
C++
How to determine if a string is a number with C++?
C++
Visual C++
Convenient C++ struct initialisation
C++
Struct
Initialization
How can I specify a [DllImport] path at runtime?
C#
C++
Dll
Constants
Dllimport
Advantages of using std::make_unique over new operator
C++
C++14
Unique Ptr
polymorphic_allocator: when and why should I use it?
C++
Allocator
C++17
My attempt at value initialization is interpreted as a function declaration, and why doesn't A a(()); solve it?
C++
_DEBUG vs NDEBUG
C++
C
Debugging
Why use #ifndef CLASS_H and #define CLASS_H in .h file but not in .cpp?
C++
When should I use C++14 automatic return type deduction?
C++
C++14
Return Type-Deduction
Initializing a two dimensional std::vector
C++
Vector
What happens to global and static variables in a shared library when it is dynamically linked?
C++
Linker
Global Variables
Global
Dynamic Linking
Generate random numbers using C++11 random library
C++
C++11
Random
Range
In practice, why would different compilers compute different values of int x = ++i + ++i;?
C++
Undefined Behavior
Why is processing an unsorted array the same speed as processing a sorted array with modern x86-64 clang?
C++
Performance
Clang
Cpu Architecture
Branch Prediction
Which, if any, C++ compilers do tail-recursion optimization?
C++
Optimization
Tail Recursion
C++ mark as deprecated
C++
Efficient way to determine number of digits in an integer
C++
Integer
Digits
What is the purpose of using -pedantic in the GCC/G++ compiler?
C++
C
Gcc
G++
print call stack in C or C++
C++
C
Linux
Callstack
C++, copy set to vector
C++
Copy
Stdvector
Stdset
How to avoid overflow in expr. A * B - C * D
C++
C
Integer Overflow
How can I get the list of files in a directory using C or C++?
C++
C
File
Directory
Read file line by line using ifstream in C++
C++
File Io
Ofstream
How to call a parent class function from derived class function?
C++
Oop
Inheritance
Why is the alphabet split into multiple ranges in this C code?
C++
C
Character
Toupper
How can I repeat a string a variable number of times in C++?
C++
How do I find the location of the executable in C?
C++
C
Linux
Unix
Path
How to convert an enum type variable to a string?
C++
C
Preprocessor
Ansi C
bool to int conversion
C++
C
C99
When to use std::forward to forward arguments?
C++
Templates
Forwarding
C++11
Why do C++ libraries and frameworks never use smart pointers?
C++
Pointers
Smart Pointers
How do I terminate a thread in C++11?
C++
Multithreading
C++11
C++ convert from 1 char to string?
C++
Casting
Why doesn't std::queue::pop return value.?
C++
Stl
Linking static libraries to other static libraries
C++
Linker
Unix Ar
.A
How can I pass a member function where a free function is expected?
C++
Arguments
Parameter Passing
Function Pointers
Pointer to-Member
C++ Redefinition Header Files (winsock2.h)
C++
Header
Redefinition
Optimizing away a "while(1);" in C++0x
C++
Loops
C++11
Language Lawyer
Undefined Behavior
How to determine the Boost version on a system?
C++
Boost
Version
What is the proper declaration of main in C++?
C++
Function
Standards
Main
C++ Faq
C/C++ macro string concatenation
C++
C
C Preprocessor
Define static method in source-file with declaration in header-file in C++
C++
Static Linking
What is the difference between packaged_task and async
C++
Multithreading
C++11
Stdasync
Packaged Task
How does std::tie work?
C++
C++11
Tuples
Why use “b < a ? a : b” instead of “a < b ? b : a” to implement max template?
C++
Templates
Check if a class has a member function of a given signature
C++
C++11
Templates
Sfinae
Why can't C++ be parsed with a LR(1) parser?
C++
Parsing
Grammar
Formal Languages
How do I expand a tuple into variadic template function's arguments?
C++
C++11
Arguments
Tuples
Java's final vs. C++'s const
Java
C++
Constants
Final
Is it smart to replace boost::thread and boost::mutex with c++11 equivalents?
C++
Multithreading
C++11
Boost
Mutex
error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
C++
Debugging
Linker
Connecting overloaded signals and slots in Qt 5
C++
Qt
Qt5
Why is there an injected class name?
C++
C++ SFINAE examples?
C++
Templates
Metaprogramming
Sfinae
What makes Scala's operator overloading "good", but C++'s "bad"?
C++
Scala
Operator Overloading
C++ code file extension? What is the difference between .cc and .cpp
C++
Filenames
How do I detect unsigned integer overflow?
C++
C
Integer Overflow
When to use volatile with multi threading?
C++
Multithreading
Concurrency
Atomic
Volatile
How can I get a file's size in C++?
C++
Filesize
error: use of deleted function
C++
Gcc
G++
C++11
Deleted Functions
error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
C++
Visual Studio
Visual C++
How can I initialize base class member variables in derived class constructor?
C++
Inheritance
Purpose of returning by const value?
C++
Constants
How to use stringstream to separate comma separated strings
C++
Tokenize
Stringstream
What does the thread_local mean in C++11?
C++
Multithreading
C++11
Thread Local
Thread Local-Storage
Conveniently Declaring Compile-Time Strings in C++
C++
String
C++11
Metaprogramming
User Defined-Literals
Is "long long" = "long long int" = "long int long" = "int long long"?
C++
Syntax
Declaration
Long Integer
How do I remove an item from a stl vector with a certain value?
C++
Stl
A free tool to check C/C++ source code against a set of coding standards?
C++
C
Coding Style
Is it safe to parse a /proc/ file?
C++
C
Linux
Unix
Procfs
How does std::forward work?
C++
C++11
Should I return EXIT_SUCCESS or 0 from main()?
C++
C
Return Value
Main
What are the differences between -std=c++11 and -std=gnu++11?
C++
Gcc
C++11
Clang
initialize a vector to zeros C++/C++11
C++
C++11
How to display a dynamically allocated array in the Visual Studio debugger?
C++
C
Visual Studio
Debugging
Alternative to itoa() for converting integer to string C++?
C++
Integer
Stdstring
Itoa
Why can't variable names start with numbers?
C++
Variables
Programming Languages
Language Design
Variable Names
Is there a way to instantiate objects from a string holding their class name?
C++
Inheritance
Factory
Instantiation
What's the point of const pointers?
C++
C
Pointers
Constants
How to set initial size of std::vector?
C++
Stl
How to throw std::exceptions with variable messages?
C++
Exception
Exception Handling
How should one use std::optional?
C++
Boost Optional
C++ Tr2
Is the operation "false < true" well defined?
C++
Boolean
Language Lawyer
Comparison Operators
How can I make my class immune to the "auto value = copy of proxy" landmine in C++?
C++
Copy Assignment
Sell me on const correctness
C++
Const Correctness
Should operator<< be implemented as a friend or as a member function?
C++
Operator Overloading
Which iomanip manipulators are 'sticky'?
C++
C++ Faq
Parsing a comma-delimited std::string
C++
String
Parsing
Stl
Csv
How to compile for Windows on Linux with gcc/g++?
C++
Opengl
Gcc
Glut
Freeglut
Is there a way to specify how many characters of a string to print out using printf()?
C++
C
Printf
What is a 'thunk'?
C++
Thunk
Beyond Stack Sampling: C++ Profilers
C++
Qt
Optimization
Profiling
Profiler
How does #include <bits/stdc++.h> work in C++?
C++
Gcc
C++11
G++
Can code that is valid in both C and C++ produce different behavior when compiled in each language?
C++
C
How to determine CPU and memory consumption from inside a process
C++
C
Memory
Cpu
What is meant with "const" at end of function declaration?
C++
Constants
*.h or *.hpp for your class definitions
C++
Header
Advantages of Antlr (versus say, lex/yacc/bison)
C++
Antlr
Yacc
Bison
Is it possible to serialize and deserialize a class in C++?
C++
Serialization
What is the bit size of long on 64-bit Windows?
C++
C
Windows
64 Bit
Porting
Need for predictable random generator
C++
Algorithm
Random
Is returning by rvalue reference more efficient?
C++
C++11
Rvalue Reference
Iterate keys in a C++ map
C++
Stl
What is better, adjacency lists or adjacency matrices for graph problems in C++?
C++
Graph
Adjacency List
Adjacency Matrix
Add custom messages in assert?
C++
Assert
Efficient way to return a std::vector in c++
C++
Return Value
Stdvector
Is #pragma once part of the C++11 standard?
C++
C++11
Macros
Header Files
C++14
stringstream, string, and char* conversion confusion
C++
String
Memory
Stringstream
Get path of executable
C++
Boost
Executable
"X does not name a type" error in C++
C++
Windows
Types
Boost Statechart vs. Meta State Machine
C++
Boost
State Machine
Boost Statechart
Boost Msm
Why I cannot cout a string?
C++
String
Cout
What can I do with a moved-from object?
C++
C++11
Variable Assignment
Swap
Move Semantics
Futures vs. Promises
C++
C++11
Promise
Future
Is there a downside to declaring variables with auto in C++?
C++
C++11
Type Inference
Auto
Why are types always a certain size no matter its value?
C++
Can a recursive function be inline?
C++
C
Compiler Construction
Should I prefer pointers or references in member data?
C++
Reference
Class Members
C++ : why bool is 8 bits long?
C++
Boolean
Size
How do I specify a pointer to an overloaded function?
C++
Stl
Kill some processes by .exe file name
C#
C++
Process
Exe
Kill Process
Why does long long n = 2000*2000*2000*2000; overflow?
C++
Math
Types
Literals
Integer Overflow
Unresolved external symbol on static class members
C++
Class
Static
Members
Why would anybody use C over C++?
C++
C
How can I see the assembly code for a C++ program?
C++
Assembly
Disassembly
Declaring pointers; asterisk on the left or right of the space between the type and name?
C++
C
Pointers
Is leaked memory freed up when the program exits?
C++
Memory Leaks
Overloading member access operators ->, .*
C++
Operator Overloading
C++ Faq
How do you set, clear, and toggle a single bit?
C++
C
Bit Manipulation
Bitwise Operators
When should static_cast, dynamic_cast, const_cast and reinterpret_cast be used?
C++
Pointers
Casting
C++ Faq
What is the difference between #include <filename> and #include "filename"?
C++
C
Include
Header Files
C Preprocessor
What is the easiest way to initialize a std::vector with hardcoded elements?
C++
Vector
Stl
Initialization
Difference of keywords 'typename' and 'class' in templates?
C++
Templates
Keyword
How do I achieve the theoretical maximum of 4 FLOPs per cycle?
C++
Assembly
X86 64
Cpu Architecture
Flops
Read whole ASCII file into C++ std::string
C++
String
Caching
File Io
Standard Library
When should I write the keyword 'inline' for a function/method?
C++
Inline
One Definition-Rule
Why can I use auto on a private type?
C++
C++11
Auto
Private Members
Why can we use `std::move` on a `const` object?
C++
C++11
Why is x[0] != x[0][0] != x[0][0][0]?
C++
Arrays
Pointers
How do you iterate through every file/directory recursively in standard C++?
C++
Filesystems
Determining 32 vs 64 bit in C++
C++
32bit 64bit
Conditional Compilation
How can I catch a ctrl-c event?
C++
Event Handling
Posix
Signals
Sigint
What is the point of a private pure virtual function?
C++
Oop
Inheritance
Non Virtual-Interface
What is the preferred/idiomatic way to insert into a map?
C++
Stl
Insert
Stdmap
Std Pair
What's the difference between assignment operator and copy constructor?
C++
Memory
Benefits of header-only libraries
C++
Header Only
What is the advantage of using forwarding references in range-based for loops?
C++
Performance
For Loop
C++11
Move Semantics
When should std::move be used on a function return value?
C++
C++11
Move Semantics
Qt 5.1.1: Application failed to start because platform plugin "windows" is missing
C++
Windows
Qt
Visual Studio-2012
Why does the enhanced GCC 6 optimizer break practical C++ code?
C++
Gcc
Compiler Optimization
Undefined Behavior
How do I sort a vector of pairs based on the second element of the pair?
C++
Stl
Stdvector
How do I convert from stringstream to string in C++?
C++
String
Stringstream
What is the closest thing Windows has to fork()?
C++
C
Windows
Fork
system("pause"); - Why is it wrong?
C++
Difference: std::runtime_error vs std::exception()
C++
Exception Handling
What platforms have something other than 8-bit char?
C++
C
Cross Platform
Why in C++ do we use DWORD rather than unsigned int?
C++
Winapi
Types
Dword
Cannot open include file 'afxres.h' in VC2010 Express
C++
Visual Studio
Winapi
Visual C++
Superiority of unnamed namespace over static?
C++
Static
Namespaces
Static Variables
Static Functions
Why are C++ inline functions in the header?
C++
Inline
Theory
Language Design
C++ Faq
What is the purpose of a single pound/hash sign (#) on its own line in the C/C++ preprocessor?
C++
C
Boost
C Preprocessor
Best documentation for Boost:asio?
C++
Boost
Boost Asio
How does delete[] know it's an array?
C++
Arrays
Pointers
New Operator
Delete Operator
Is it safe to use -1 to set all bits to true?
C++
C
Binary
Bit Fields
Using scanf() in C++ programs is faster than using cin?
C++
C
Performance
Io
Difference between string and char[] types in C++
C++
String
Types
Private virtual method in C++
C++
Polymorphism
Access Specifier
Initialize parent's protected members with initialization list (C++)
C++
Inheritance
Constructor
Initialization List
C++0x has no semaphores? How to synchronize threads?
C++
Multithreading
Synchronization
C++11
Boost Thread
C++ Build Systems - What to use?
C++
Build
Mismatch Detected for 'RuntimeLibrary'
C++
Hash
Compilation
Sha256
Crypto++
Is effective C++ still effective?
C++
C++11
Coding Style
Effective C++
Why is (a % 256) different than (a & 0xFF)?
C++
Optimization
Creating my own Iterators
C++
Iterator
What new capabilities do user-defined literals add to C++?
C++
C++11
User Defined-Literals
How to automatically generate a stacktrace when my program crashes
C++
Gcc
Crash
Stack Trace
Assert
How can I convert a std::string to int?
C++
String
Integer
How do I find the length of an array?
C++
Arrays
When can I use a forward declaration?
C++
Forward Declaration
C++ Faq
C++ convert hex string to signed integer
C++
Integer
Hex
Signed
When would anyone use a union? Is it a remnant from the C-only days?
C++
C
Unions
what is the difference between const_iterator and iterator?
C++
Stl
Iterator
Const Iterator
LLVM vs clang on OS X
C++
C
Gcc
Llvm
Clang
Why does C++ rand() seem to generate only numbers of the same order of magnitude?
C++
C
Math
Random
Pointer expressions: *ptr++, *++ptr and ++*ptr
C++
C
Pointers
Increment
When and why will a compiler initialise memory to 0xCD, 0xDD, etc. on malloc/free/new/delete?
C++
C
Memory
Memory Management
How many and which are the uses of "const" in C++?
C++
Constants
What does the Q_OBJECT macro do? Why do all Qt objects need this macro?
C++
Qt
Macros
do {...} while(false)
C++
Why doesn't c++ have &&= or ||= for booleans?
C++
Boolean Operations
Conditions for automatic generation of default/copy/move ctor and copy/move assignment operator?
C++
Copy Constructor
Default Constructor
Move Constructor
Move Assignment-Operator
Is pass-by-value a reasonable default in C++11?
C++
Coding Style
C++11
Template function inside template class
C++
Templates
Is there auto type inferring in Java?
Java
C++
Auto
Qt: How do I handle the event of the user pressing the 'X' (close) button?
C++
Qt
What is the idea behind ^= 32, that converts lowercase letters to upper and vice versa?
C++
Bit Manipulation
Ascii
What is going on with 'gets(stdin)' on the site coderbyte?
C++
Input
Gets
Standards Compliance
how does array[100] = {0} set the entire array to 0?
C++
C
Compiler Construction
Should I compile with /MD or /MT?
C++
Visual Studio
Msbuild
Msvcrt
Crt
Default value of function parameter
C++
Syntax
Optional Parameters
Is a `=default` move constructor equivalent to a member-wise move constructor?
C++
C++11
Constructor
Default
Move Semantics
CMake error at CMakeLists.txt:30 (project): No CMAKE_C_COMPILER could be found
C++
Visual Studio
Gcc
Cmake
Visual Studio-2015
Why should the "PIMPL" idiom be used?
C++
Oop
Information Hiding
Pimpl Idiom
Why do we need extern "C"{ #include <foo.h> } in C++?
C++
Linkage
Name Mangling
Extern C
Elegant solution to duplicate, const and non-const, getters?
C++
Constants
C++, Free-Store vs Heap
C++
Memory Management
What is more efficient? Using pow to square or just multiply it with itself?
C++
C
Optimization
How to pass optional arguments to a method in C++?
C++
Optional Arguments
Colorizing text in the console with C++
C++
Colors
Colorize
How to convert boost path type to string?
C++
Boost
Path
Are the days of passing const std::string & as a parameter over?
C++
C++11
Check if a string contains a string in C++
C++
String
Substring
"std::endl" vs "\n"
C++
Coding Style
Iostream
C++ Faq
Why are #ifndef and #define used in C++ header files?
C++
C
C Preprocessor
Why is iostream::eof inside a loop condition (i.e. `while (!stream.eof())`) considered wrong?
C++
Iostream
C++ Faq
Storing C++ template function definitions in a .CPP file
C++
Templates
How do I erase an element from std::vector<> by index?
C++
Stl
Vector
Erase
How to build Qt for Visual Studio 2010
C++
Visual Studio
Visual Studio-2010
Qt
Build
Setting an int to Infinity in C++
C++
Infinity
OS specific instructions in CMAKE: How to?
C++
Linux
Cmake
Mingw
Portability
Why is inequality tested as (!(a==b)) in a lot of C++ standard library code?
C++
How do you copy the contents of an array to a std::vector in C++ without looping?
C++
Stl
Vector
Copy
Getting GDB to save a list of breakpoints
C++
C
Debugging
Gdb
Breakpoints
Where do I find the definition of size_t?
C++
C
Variables
Order of member constructor and destructor calls
C++
Explicit specialization in non-namespace scope
C++
Templates
Gcc
How to emulate C array initialization "int arr[] = { e1, e2, e3, ... }" behaviour with std::array?
C++
Arrays
Templates
Initialization
C++11
Is it possible to figure out the parameter type and return type of a lambda?
C++
Lambda
Metaprogramming
C++11
Traits
What does the fpermissive flag do?
C++
Gcc
Compiler Options
Equivalent C++ to Python generator pattern
C++
Python
Generator
Yield
Coroutine
What happens if I define a 0-size array in C/C++?
C++
C
Arrays
CMake output/build directory
C++
Build
Makefile
Cmake
Output
What happens if you call erase() on a map element while iterating from begin to end?
C++
Stl
Iterator
What is the difference between exit() and abort()?
C++
C
Error Handling
Exit
Abort
How do I compile a Visual Studio project from the command-line?
C++
Python
Visual Studio-2008
Command Line
Passing references to pointers in C++
C++
Pointers
Reference
How can you iterate over the elements of an std::tuple?
C++
C++11
Iteration
Template Meta-Programming
Stdtuple
C/C++ maximum stack size of program on mainstream OSes
C++
C
Operating System
Stack Memory
Difference between 'new operator' and 'operator new'?
C++
Cast to int vs floor
C++
C
Floating Point
What does it mean for a data structure to be "intrusive"?
C++
C
Language Agnostic
Data Structures
Terminology
How to implement static class member functions in *.cpp file?
C++
Type erasure techniques
C++
Type Erasure
Disable single warning error
C++
Visual C++
Warnings
Pragma
C++: How to round a double to an int?
C++
Floating Point
Rounding
How can I efficiently select a Standard Library container in C++11?
C++
C++11
C++ Faq
Iterator Loop vs index loop
C++
Loops
C++11
Indexing
Iterator
C/C++ NaN constant (literal)?
C++
C
Nan
Why does C++11 not support designated initializer lists as C99?
C++
C
C++11
Initialization
C99
How much is the overhead of smart pointers compared to normal pointers in C++?
C++
Performance
C++11
Smart Pointers
Is it safe to link C++17, C++14, and C++11 objects
C++
C++11
Linker
C++14
Abi
Why is C++ initial allocation so much larger than C's?
C++
C
Benchmarking
Easiest way to flip a boolean value?
C++
C
Boolean
Boolean Logic
Why doesn't delete set the pointer to NULL?
C++
Memory Management
Delete Operator
How to break out of a loop from inside a switch?
C++
Loops
Syntax
Switch Statement
Break
const char* concatenation
C++
C
String Concatenation
C++ where to initialize static const
C++
Static
Initialization
Constants
Choosing between std::map and std::unordered_map
C++
C++11
Hash
Map
Unordered Map
Configuring Vim for C++
C++
Vim
Configuration
/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found
C++
Gcc
Libstdc++
What are Aggregates and PODs and how/why are they special?
C++
C++11
Aggregate
C++17
Standard Layout
What does "dereferencing" a pointer mean?
C++
C
Pointers
Dereference
Difference between static and shared libraries?
C++
C
Shared Libraries
Static Libraries
How to remove unused C/C++ symbols with GCC and ld?
C++
C
Gcc
Ld
Strip
How to printf uint64_t? Fails with: "spurious trailing ‘%’ in format"
C++
C
Accessing inactive union member and undefined behavior?
C++
Undefined Behavior
Language Lawyer
Unions
What is the difference between .cc and .cpp file suffix?
C++
Is there actually a reason why overloaded && and || don't short circuit?
C++
C++11
Operator Overloading
Logical Operators
Short Circuiting
Why can't C functions be name-mangled?
C++
C
Name Mangling
Extern C
C++ zero initialization - Why is `b` in this program uninitialized, but `a` is initialized?
C++
Initialization
Language Lawyer
Unit testing for C++ code - Tools and methodology
C++
Unit Testing
Refactoring
Detect if stdin is a terminal or pipe?
C++
C
Qt
Pipe
Stdin
Calling C++ member functions via a function pointer
C++
Function Pointers
Class Method
Difference between CC, gcc and g++?
C++
C
Gcc
Compilation
Why should the copy constructor accept its parameter by reference in C++?
C++
Constructor
Copy
Copy Constructor
#include in .h or .c / .cpp?
C++
C
Passing variable arguments to another function that accepts a variable argument list
C++
Variadic Functions
What is uint_fast32_t and why should it be used instead of the regular int and uint32_t?
C++
C
Types
C++ wait for user input
C++
How can I pass std::unique_ptr into a function
C++
C++11
Unique Ptr
Most elegant way to write a one-shot 'if'
C++
If Statement
C++17
What does 'const static' mean in C and C++?
C++
C
How do I write a short literal in C++?
C++
Literals
Double Negation in C++
C++
Boolean
Virtual functions and performance - C++
C++
Performance
Optimization
Virtual Functions
remove_if equivalent for std::map
C++
Stl
Map
Default value to a parameter while passing by reference in C++
C++
Pass by-Reference
Default Value
What is a .h.gch file?
C++
G++
Restore the state of std::cout after manipulating it
C++
Iostream
Operator overloading : member function vs. non-member function?
C++
Operator Overloading
Member Functions
Friend Function
Non Member-Functions
Reading and writing binary file
C++
File
Binary
Buffer
Writing your own STL Container
C++
Stl
C++ Standard-Library
C++, variable declaration in 'if' expression
C++
Compilation
If Statement
Variable Declaration
Move assignment operator and `if (this != &rhs)`
C++
C++11
Move Semantics
Move Assignment-Operator
Why can't I initialize non-const static member or static array in class?
C++
Static
Constants
Windows threading: _beginthread vs _beginthreadex vs CreateThread C++
C++
C
Multithreading
Winapi
Position of least significant bit that is set
C++
C
Optimization
Bit Manipulation
When should I really use noexcept?
C++
C++11
Exception
Noexcept
What exactly is nullptr?
C++
Pointers
C++11
Nullptr
What does int argc, char *argv[] mean?
C++
Parameters
Command Line-Arguments
Argv
Argc
Does it make any sense to use inline keyword with templates?
C++
Templates
Inline
Why are function pointers and data pointers incompatible in C/C++?
C++
C
Pointers
Function Pointers
How to forward declare a C++ template class?
C++
Templates
Forward Declaration
Difference between `const shared_ptr<T>` and `shared_ptr<const T>`?
C++
Boost
Constants
Shared Ptr
What's the meaning of exception code "EXC_I386_GPFLT"?
C++
C
Exc Bad-Access
Copy/move assignment in std::vector::erase() and std::deque::erase()
C++
Language Lawyer
C++14
CMake does not find Visual C++ compiler
C++
Cmake
Visual Studio-2015
Can inner classes access private variables?
C++
Inner Classes
C++ template constructor
C++
Templates
Constructor
C++ Returning reference to local variable
C++
How fast is D compared to C++?
C++
Performance
Runtime
D
extra qualification error in C++
C++
G++
Compiler Errors
Why do std::shared_ptr<void> work
C++
C++11
Shared Ptr
Do c++11 lambdas capture variables they don't use?
C++
Lambda
C++11
What's the best way to iterate over two or more containers simultaneously
C++
C++11
Iterator
Containers
How to initialize const member variable in a class?
C++
Constants
Why does std::getline() skip input after a formatted extraction?
C++
Input
Iostream
Istream
C++ Faq
Why do C and C++ compilers allow array lengths in function signatures when they're never enforced?
C++
C
Arrays
How to convert std::string to LPCWSTR in C++ (Unicode)
C++
Winapi
Default parameters with C++ constructors
C++
Constructor
Coding Style
Overloading
A std::map that keep track of the order of insertion?
C++
Dictionary
Std
Insertion Order
Purpose of Trigraph sequences in C++?
C++
C++03
Trigraphs
Python-equivalent of short-form "if" in C++
C++
Python
Syntax
Why can't I use float value as a template parameter?
C++
Templates
Generics
Floating Point
How to use clock() in C++
C++
Benchmarking
Clock
How to construct a std::string from a std::vector<char>?
C++
"using namespace" in c++ headers
C++
Namespaces
Header Files
Polymorphism in C++
C++
Polymorphism
C++ Faq
Why does integer overflow on x86 with GCC cause an infinite loop?
C++
C
Gcc
X86
Undefined Behavior
How can I use a C++ library from node.js?
Javascript
C++
node.js
Binding
When is a C++ destructor called?
C++
Destructor
What is the meaning of the term arena in relation to memory?
C++
C
Memory Management
Terminology
C++ project organisation (with gtest, cmake and doxygen)
C++
Cmake
Doxygen
Googletest
Does constexpr imply inline?
C++
C++11
Inline
Standards Compliance
Constexpr
Modern way to filter STL container?
C++
C++11
Stl
Why is `std::move` named `std::move`?
C++
C++11
Move Semantics
Rvalue Reference
C++ Faq
Can I mix Swift with C++? Like the Objective-C .mm files
C++
Objective C
Swift
Any optimization for random access on a very big array when the value in 95% of cases is either 0 or 1?
C++
Arrays
Performance
Optimization
Memory Bandwidth
What are the advantages of using the C++ Boost libraries?
C++
Boost
Is there a simple way to convert C++ enum to string?
C++
String
Enums
Scripting
Is modern C++ becoming more prevalent?
C++
What does static_assert do, and what would you use it for?
C++
Debugging
C++11
Assert
Static Assert
In C/C++ what's the simplest way to reverse the order of bits in a byte?
C++
C
Bit Manipulation
Who architected / designed C++'s IOStreams, and would it still be considered well-designed by today's standards?
C++
Iostream
How would one call std::forward on all arguments in a variadic function?
C++
C++11
Variadic Templates
Rvalue Reference
Perfect Forwarding
Is null reference possible?
C++
Reference
Null
Language Lawyer
Is main() really start of a C++ program?
C++
Standards Compliance
Main
Entry Point
What is the most effective way for float and double comparison?
C++
Algorithm
Optimization
Floating Point
Undefined, unspecified and implementation-defined behavior
C++
C
Undefined Behavior
Unspecified Behavior
Implementation Defined-Behavior
using extern template (C++11)
C++
Templates
C++11
Extern
Why does the use of 'new' cause memory leaks?
C++
Pointers
Memory Leaks
New Operator
C++ Faq
Unable to load DLL (Module could not be found HRESULT: 0x8007007E)
C#
C++
Dll
Pinvoke
Does async(launch::async) in C++11 make thread pools obsolete for avoiding expensive thread creation?
C++
Multithreading
Asynchronous
C++11
Threadpool
Is there a C++ decompiler?
C++
Reverse Engineering
Decompiling
How to easily map c++ enums to strings
C++
Templates
Enums
Segmentation fault on large array sizes
C++
Arrays
Segmentation Fault
How to clear stringstream?
C++
Stringstream
Iterating C++ vector from the end to the beginning
C++
Vector
Iterator
How to forward declare a template class in namespace std?
C++
Templates
G++
How do I explicitly instantiate a template function?
C++
Templates
Copy constructor for a class with unique_ptr
C++
C++11
Unique Ptr
How to use the same C++ code for Android and iOS?
Java
C++
Java Native-Interface
Cross Platform
Objective C++
Is it safe to push_back an element from the same vector?
C++
Vector
Reference
Language Lawyer
Push Back
In release mode, code behavior is not as expected
C++
C
Optimization
Visual Studio-2008
Compiler Bug
What are coroutines in C++20?
C++
Coroutine
C++20
General guidelines to avoid memory leaks in C++
C++
Memory
Memory Management
Raii
string c_str() vs. data()
C++
Stl
C Str
What does template <unsigned int N> mean?
C++
Templates
Why isn't `int pow(int base, int exponent)` in the standard C++ libraries?
C++
Math
Integer
Standard Library
Pow
abort, terminate or exit?
C++
Fatal error: "No Target Architecture" in Visual Studio
C++
Windows
Visual Studio
Visual C++
Compiler Errors
Is sizeof(bool) defined in the C++ language standard?
C++
Boolean
Sizeof
Implementation Defined-Behavior
Flags to enable thorough and verbose g++ warnings
C++
G++
Warnings
Why does dividing two int not yield the right value when assigned to double?
C++
Variables
Double
Integer Division
Passing a std::array of unknown size to a function
C++
C++11
Stdarray
How to remove all the occurrences of a char in c++ string
C++
Stl
Why does this C++ snippet compile (non-void function does not return a value)
C++
Visual Studio-2012
C++11
Methods
What does Visual Studio do with a deleted pointer and why?
C++
Pointers
Visual Studio-2012
Memory Management
Delete Operator
Enforcing statement order in C++
C++
C++11
Operator Precedence
What is the purpose of a unary "+" before a call to std::numeric_limits<unsigned char> members?
C++
Char
Unary Operator
How can I create directory tree in C++/Linux?
C++
Linux
Directory
Inline functions vs Preprocessor macros
C++
C
Macros
Inline
Significance of a .inl file in C++
C++
How to compile a 64-bit application using Visual C++ 2010 Express?
C++
64 Bit
Visual Studio-Express
How do I declare a 2d array in C++ using new?
C++
Arrays
Multidimensional Array
Dynamic Allocation
Use 'class' or 'typename' for template parameters?
C++
Templates
What is the printf format specifier for bool?
C++
C
Boolean
Printf
Why is enum class preferred over plain enum?
C++
Class
Enums
C++ Faq
Override compile flags for single files
C++
Cmake
Compiler Warnings
Should I use an exception specifier in C++?
C++
Function
Exception
Throw
Specifier
C++ map access discards qualifiers (const)
C++
Stl
Constants
Maps
Use C++ with Cocoa Instead of Objective-C?
C++
Objective C
Cocoa
Language Interoperability
Should I learn C before learning C++?
C++
C
When should I use C++ private inheritance?
C++
Oop
How does BLAS get such extreme performance?
C++
Fortran
C++ Exceptions questions on rethrow of original exception
C++
Exception
Rethrow
How can I create Min stl priority_queue?
C++
Stl
Priority Queue
Set breakpoint in C or C++ code programmatically for gdb on Linux
C++
C
Linux
Gdb
How to convert a number to string and vice versa in C++
C++
String
Type Conversion
Numeric
C++ Faq
Should I pass a shared_ptr by reference?
C++
Shared Ptr
std::shared_ptr of this
C++
This
Shared Ptr
This Pointer
When to make a type non-movable in C++11?
C++
C++11
Move Semantics
C++ Faq
Arrays vs Vectors: Introductory Similarities and Differences
C++
Arrays
Vector
Why isn't vector<bool> a STL container?
C++
Vector
Stl
Containers
Bitvector
Most simple but complete CMake example
C++
Cmake
Project Setup
Why does Clang optimize away x * 1.0 but NOT x + 0.0?
C++
C
Optimization
Floating Point
Clang
Lambda returning itself: is this legal?
C++
Lambda
Language Lawyer
C++17
Auto
How do I make a fully statically linked .exe with Visual Studio Express 2005?
C++
Visual Studio
Linker
'const int' vs. 'int const' as function parameters in C++ and C
C++
C
Constants
C++ templates Turing-complete?
C++
Templates
Template Meta-Programming
Turing Complete
error: ‘NULL’ was not declared in this scope
C++
Gcc
Pointers
Null
Explicit template instantiation - when is it used?
C++
Templates
Why is std::min failing when windows.h is included?
C++
Visual Studio-2005
Finding duplicates in O(n) time and O(1) space
C++
C
Algorithm
Incomplete type is not allowed: stringstream
C++
Types
Stringstream
Creating an object: with or without `new`
C++
Constructor
New Operator
Destructor
":" (colon) in C struct - what does it mean?
C++
C
throw new std::exception vs throw std::exception
C++
Exception
How to convert string to char array in C++?
C++
String
Type Conversion
How does generic lambda work in C++14?
C++
Lambda
Auto
C++14
Using this pointer causes strange deoptimization in hot loop
C++
C++11
Optimization
Compiler Optimization
Strict Aliasing
Why does cout print "2 + 3 = 15" in this snippet of code?
C++
Unnamed/anonymous namespaces vs. static functions
C++
Namespaces
Iterator invalidation rules for C++ containers
C++
Iterator
C++ Standard-Library
C++ Faq
Why does C++ compilation take so long?
C++
Performance
Compilation
Should I use #define, enum or const?
C++
Enums
Bit Manipulation
C Preprocessor
Spinlock versus Semaphore
C++
C
Linux
Unix
Operating System
What is the difference between an int and a long in C++?
C++
Variables
Best C++ Code Formatter/Beautifier
C++
Code Formatting
Are std::vector elements guaranteed to be contiguous?
C++
Vector
Standards
Why is the use of tuples in C++ not more common?
C++
Tuples
A good example for boost::algorithm::join
C++
String
Boost
Join
Can I assume (bool)true == (int)1 for any C++ compiler?
C++
Casting
Boolean
Concatenate two string literals
C++
String
Syntax
Operators
Concatenation
Sequence-zip function for c++11?
C++
C++11
Sequences
std::shared_ptr thread safety explained
C++
C++11
Shared Ptr
std::array vs array performance
C++
C++11
Stdarray
Is using if (0) to skip a case in a switch supposed to work?
C++
C
If Statement
Switch Statement
Language Lawyer
How are virtual functions and vtable implemented?
C++
Polymorphism
Virtual Functions
Vtable
How do I flush the cin buffer?
C++
Cin
Io Buffering
Is it possible to program iPhone in C++
C++
Iphone
Objective C
How do exceptions work (behind the scenes) in c++
C++
Performance
Exception
Throw
Try Catch
LPCSTR, LPCTSTR and LPTSTR
C++
Windows
Visual C++
Mfc
Generating UML from C++ code?
C++
Uml
Pointers, smart pointers or shared pointers?
C++
Pointers
Proper stack and heap usage in C++?
C++
Memory Management
Stack
Heap Memory
C++ Faq
Pimpl idiom vs Pure virtual class interface
C++
Abstract Class
Pimpl Idiom
Where is C not a subset of C++?
C++
C
Why aren't pointers initialized with NULL by default?
C++
Memory
Pointers
Initialization
When does invoking a member function on a null instance result in undefined behavior?
C++
Undefined Behavior
Language Lawyer
Standards Compliance
Null Pointer
error: default argument given for parameter 1
C++
Function
Default Arguments
Why is address zero used for the null pointer?
C++
C
Memory
Pointers
C/C++ line number
C++
C
C Preprocessor
Line Numbers
Dynamic Compilation
Can I compile all .cpp files in src/ to .o's in obj/, then link to binary in ./?
C++
Build Process
Makefile
C++ performance challenge: integer to std::string conversion
C++
Performance
String
Integer
`const char * const` versus `const char *`?
C++
What C++ Smart Pointer Implementations are available?
C++
Smart Pointers
C++ Faq
Compile error: "g++: error trying to exec 'cc1plus': execvp: No such file or directory"
Php
C++
C
Linux
Gcc
How can I output the value of an enum class in C++11
C++
C++11
Templates
Enums
Enum Class
Legality of COW std::string implementation in C++11
C++
String
C++11
Stdstring
Copy on-Write
const before parameter vs const after function name c++
C++
Function
Constants
declaring a priority_queue in c++ with a custom comparator
C++
Std
Priority Queue
Lambda capture and parameter with same name - who shadows the other? (clang vs gcc)
C++
C++11
Lambda
Language Lawyer
Shadowing
Why does the delete[] syntax exist in C++?
C++
Memory Management
Syntax
Language Lawyer
Standards
How to overload std::swap()
C++
Performance
Optimization
Stl
C++ Faq
How do you detect/avoid Memory leaks in your (Unmanaged) code?
C++
C
Memory Leaks
#ifdef vs #if - which is better/safer as a method for enabling/disabling compilation of particular sections of code?
C++
C
If Statement
Coding Style
C Preprocessor
What can I use instead of the arrow operator, `->`?
C++
Pointers
How to Calculate Execution Time of a Code Snippet in C++
C++
Benchmarking
How to navigate through a vector using iterators? (C++)
C++
Iterator
Vector
C/C++ Struct vs Class
C++
Class
Struct
Const map element access
C++
Dictionary
Stl
Constants
How to initialize private static members in C++?
C++
Initialization
Static Members
Templated check for the existence of a class member function?
C++
Templates
Template Meta-Programming
Sfinae
How to tell where a header file is included from?
C++
C
Gcc
Include
G++
How do I use CMake?
C++
Visual Studio
Cmake
vector::at vs. vector::operator[]
C++
Stl
Stdvector
How to check for the type of a template parameter?
C++
Templates
Does const mean thread-safe in C++11?
C++
C++11
Thread Safety
Constants
C++ Faq
How to concatenate two strings in C++?
C++
How to get error message when ifstream open fails
C++
Error Handling
Stream
Std
"please check gdb is codesigned - see taskgated(8)" - How to get gdb installed with homebrew code signed?
C++
Eclipse
Macos
Gdb
Homebrew
How to succinctly, portably, and thoroughly seed the mt19937 PRNG?
C++
C++11
Random
Reading from text file until EOF repeats last line
C++
Iostream
Fstream
C++ IDE for Macs
C++
Macos
Ide
When to use "new" and when not to, in C++?
C++
New Operator
What does -fPIC mean when building a shared library?
C++
C
Gcc
Fpic
How to convert std::string to LPCSTR?
C++
Windows
String
What's the difference between deque and list STL containers?
C++
List
Stl
Deque
Is there a __CLASS__ macro in C++?
C++
Macros
How to link C++ program with Boost using CMake
C++
Boost
Cmake
undefined reference to `WinMain@16'
C++
Eclipse
Eclipse Cdt
Yes/No message box using QMessageBox
C++
Qt
Qmessagebox
Avoiding if statement inside a for loop?
C++
C++11
For Loop
Design Patterns
How to declare std::unique_ptr and what is the use of it?
C++
Pointers
Std
Unique Ptr
Is 1.0 a valid output from std::generate_canonical?
C++
C++11
Random
Constexpr vs macros
C++
C++11
Macros
Constexpr
How to get the number of characters in a std::string?
C++
String
Stdstring
String Length
map vs. hash_map in C++
C++
Map
Hashmap
How to initialize a private static const map in C++?
C++
Static
Map
Initialization
Constants
What belongs in an educational tool to demonstrate the unwarranted assumptions people make in C/C++?
C++
C
Cross Platform
Portability
How to drive C#, C++ or Java compiler to compute 1+2+3+...+1000 at compile time?
C#
Java
C++
Compiler Construction
Metaprogramming
Inheriting from a template class in c++
C++
Templates
Inheritance
std::next_permutation Implementation Explanation
C++
C++11
Permutation
Stl Algorithm
Lexicographic
Passing shared_ptr<Derived> as shared_ptr<Base>
C++
Casting
C++11
Shared Ptr
Smart Pointers
What does flushing the buffer mean?
C++
Input
Buffer
Output
Flush
How to install the Raspberry Pi cross compiler on my Linux host machine?
C++
Linux
Arm
Cross Compiling
Raspberry Pi
What is the difference between std::reference_wrapper and a simple pointer?
C++
Pointers
C++11
Reference
Reference Wrapper
Why do linked lists use pointers instead of storing nodes inside of nodes
C++
Pointers
Linked List
Qt Creator - Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild
C++
Xcode
Macos
Qt
Qt Creator
Which header should I include for `size_t`?
C++
Typedef
Debugging with command-line parameters in Visual Studio
C++
Visual Studio
Debugging
Command Line
Does the 'mutable' keyword have any purpose other than allowing the variable to be modified by a const function?
C++
Keyword
Mutable
Calling C/C++ from Python?
C++
Python
C
Fastest way to check if a file exists using standard C++/C++11,14,17/C?
C++
C
File
Stream
Smart pointers: who owns the object?
C++
Memory Management
Smart Pointers
Ownership Semantics
How to reuse an ostringstream?
C++
Stl
Reset
Ostringstream
Adding external library into Qt Creator project
C++
Winapi
Qt
Qt Creator
C++ preprocessor __VA_ARGS__ number of arguments
C++
C
C Preprocessor
Variadic Macros
Optional Parameters with C++ Macros
C++
Macros
How to identify platform/compiler from preprocessor macros?
C++
Macros
Cross Platform
C Preprocessor
What is the meaning of the term "free function" in C++?
C++
c++0x: proper way to receive a lambda as parameter by reference
C++
Lambda
C++11
Function Prototypes
Function Parameter
Creating an instance of class
C++
Class
Constructor
C++ compile error: has initializer but incomplete type
C++
Compilation
Istringstream
What exactly does stringstream do?
C++
Sstream
Why is a public const method not called when the non-const one is private?
C++
Overloading
Overload Resolution
Private Methods
Const Method
What would be C++ limitations compared C language?
C++
C
Why cast unused return values to void?
C++
C
Void
'size_t' vs 'container::size_type'
C++
Size Type
Container Data-Type
Generate random numbers following a normal distribution in C/C++
C++
C
Random
Distribution
Normal Distribution
Compiling simple Hello World program on OS X via command line
C++
Xcode
Macos
Cannot find or open the PDB file in Visual Studio C++ 2010
C++
Visual Studio-2010
Pdb Files
How far can memory leaks go?
C++
C
Memory
Memory Leaks
boost::flat_map and its performance compared to map and unordered_map
C++
Boost
Map
Does C++ have a package manager like npm, pip, gem, etc?
C++
unresolved external symbol __imp__fprintf and __imp____iob_func, SDL2
C++
Sdl 2
Visual Studio-2015
Unresolved External
Visual Studio 2015 doesn't have cl.exe
C++
Visual Studio-2015
Does C++11 unique_ptr and shared_ptr able to convert to each other's type?
C++
C++11
Shared Ptr
Unique Ptr
What does "return {}" statement mean in C++11?
C++
C++11
Return
Return Value
List Initialization
Why is #include <string> preventing a stack overflow error here?
C++
String
Stack Overflow
Explicit
Where can I get a "useful" C++ binary search algorithm?
C++
Algorithm
Stl
Binary Search
C/C++ check if one bit is set in, i.e. int variable
C++
C
Bit Manipulation
How can I make Visual Studio's build be very verbose?
C++
Visual Studio
Build Process
64-bit version of Boost for 64-bit windows
C++
Visual Studio-2008
Boost
Replace substring with another substring C++
C++
String
Replace
Substring
What is The Rule of Three?
C++
Copy Constructor
Assignment Operator
C++ Faq
Rule of-Three
Why are elementwise additions much faster in separate loops than in a combined loop?
C++
Performance
X86
Vectorization
Compiler Optimization
What are the basic rules and idioms for operator overloading?
C++
Operators
Operator Overloading
C++ Faq
What is the copy-and-swap idiom?
C++
Copy Constructor
Assignment Operator
C++ Faq
Copy and-Swap
usr/bin/ld: cannot find -l<nameOfTheLibrary>
C++
Linux
G++
How to replace all occurrences of a character in string?
C++
Algorithm
Str Replace
Stdstring
Is cout synchronized/thread-safe?
C++
Gcc
C++11
C++ terminate called without an active exception
C++
Multithreading
Deadlock
C++11
Correct way to define C++ namespace methods in .cpp file
C++
Coding Style
Namespaces
Comma in C/C++ macro
C++
C
Macros
C Preprocessor
Qt: can't find -lGL error
C++
Qt
Compiler Construction
Qt Creator
Ubuntu 13.04
Why do we need argc while there is always a null at the end of argv?
C++
C
Main
What are the mechanics of short string optimization in libc++?
C++
String
Optimization
C++ Standard-Library
Libc++
How to properly check if std::function is empty in C++11?
C++
C++11
Std Function
Is there a compiler hint for GCC to force branch prediction to always go a certain way?
C++
Gcc
Intel
Pragma
Branch Prediction
What does "int& foo()" mean in C++?
C++
Function
Return by-Reference
C++ performance vs. Java/C#
C#
Java
C++
Performance
Bytecode
Efficient string concatenation in C++
C++
Performance
String
Concatenation
What is the performance cost of having a virtual method in a C++ class?
C++
Performance
Virtual Functions
When should I make explicit use of the `this` pointer?
C++
This
Coding Practices which enable the compiler/optimizer to make a faster program
C++
C
Performance
Optimization
What exactly do "IB" and "UB" mean?
C++
Terminology
Definition
Fixing Segmentation faults in C++
C++
Debugging
Segmentation Fault
What is the difference between std::array and std::vector? When do you use one over other?
C++
Arrays
Vector
Explicit Return Type of Lambda
C++
Visual C++
Lambda
C++11
Visual C++-2012
CMake unable to determine linker language with C++
C++
C
Cmake
Can an enum class be converted to the underlying type?
C++
C++11
How do you disable the unused variable warnings coming out of gcc in 3rd party code I do not wish to edit?
C++
Gcc
Compiler Warnings
Compiler Flags
How did I get a value larger than 8 bits in size from an 8-bit integer?
C++
Gcc
Undefined Behavior
How do I safely pass objects, especially STL objects, to and from a DLL?
C++
Windows
Dll
Stl
Abi
What does ## (double hash) do in a preprocessor directive?
C++
C
Concatenation
C Preprocessor
How to call clang-format over a cpp project folder?
C++
Clang
Clang Format
Image to ASCII art conversion
C++
Image Processing
Bitmap
2d
Ascii Art
Visual Studio Code formatting for "{ }"
C++
Ubuntu
Visual Studio-Code
Lint
Why does the ternary operator with commas evaluate only one expression in the true case?
C++
Language Lawyer
Operator Precedence
Conditional Operator
How to improve logic to check whether 4 boolean values match some cases
C++
If Statement
How do you add a timed delay to a C++ program?
C++
Time
How can I propagate exceptions between threads?
C++
Multithreading
Exception
Most used parts of Boost
C++
Boost
visual c++: #include files from other projects in the same solution
C++
Visual Studio
Projects and-Solutions
Example for boost shared_mutex (multiple reads/one write)?
C++
Multithreading
Boost
Mutex
Boost Thread
Using std Namespace
C++
Namespaces
Is "argv[0] = name-of-executable" an accepted standard or just a common convention?
C++
C
Standards
Argv
Floating point vs integer calculations on modern hardware
C++
X86
Floating Point
X86 64
How are VST Plugins made?
C++
Audio
Vst
How does `is_base_of` work?
C++
Templates
Overloading
Implicit Conversion
Typetraits
Can I call memcpy() and memmove() with "number of bytes" set to zero?
C++
C
Pointers
Memcpy
Memmove
What does string::npos mean in this code?
C++
Stdstring
C++ Standard-Library
No == operator found while comparing structs in C++
C++
Struct
Comparison Operators
Reset C int array to zero : the fastest way?
C++
C
Arrays
Memset
How to return smart pointers (shared_ptr), by reference or by value?
C++
Return
Smart Pointers
Is there a better way to express nested namespaces in C++ within the header
C++
Syntax
Namespaces
std::string formatting like sprintf
C++
String
Formatting
Stdstring
C++ Standard-Library
In what cases do I use malloc and/or new?
C++
Memory Management
Malloc
New Operator
How to get current time and date in C++?
C++
Date
Time
Cross Platform
How to use the PI constant in C++
C++
Trigonometry
How to find if a given key exists in a C++ std::map
C++
Dictionary
Stl
When to use reinterpret_cast?
C++
Casting
Reinterpret Cast
How do I list the symbols in a .so file
C++
C
Gcc
Symbols
Name Mangling
Is it possible to print a variable's type in standard C++?
C++
Variables
C++11
Typeof
What is the difference between cout, cerr, clog of iostream header in c++? When to use which one?
C++
Iostream
Cout
Clog
Are vectors passed to functions by value or by reference in C++
C++
Arrays
Vector
When using C headers in C++, should we use functions from std:: or the global namespace?
C++
Language Lawyer
Std
Why are the fast integer types faster than the other integer types?
C++
C
Performance
Types
Int
Where do "pure virtual function call" crashes come from?
C++
Polymorphism
Virtual Functions
Pure Virtual
Best introduction to C++ template metaprogramming?
C++
Templates
Metaprogramming
C99 stdint.h header and MS Visual Studio
C++
C
Visual Studio
C99
Unmangling the result of std::type_info::name
C++
Gcc
Name Mangling
Calling Objective-C method from C++ member function?
C++
Objective C
Is there an online name demangler for C++?
C++
Demangler
How do I assign an alias to a function name in C++?
C++
Alias
multiple definition of template specialization when using different objects
C++
Templates
How to create a static library with g++?
C++
Gcc
Compiler Construction
G++
How to shuffle a std::vector?
C++
Shuffle
Stdvector
C++ Best way to get integer division and remainder
C++
Division
What's the fundamental difference between MFC and ATL?
C++
Visual C++
Mfc
Atl
Different floating point result with optimization enabled - compiler bug?
C++
Optimization
G++
C++ Faq
undefined reference to boost::system::system_category() when compiling
C++
Boost
Is there a function to copy an array in C/C++?
C++
C
Arrays
How can I solve the error LNK2019: unresolved external symbol - function?
C++
Testing
Error Handling
Lnk2019
What are transparent comparators?
C++
C++14
C++ Faq
What is an SDL renderer?
C++
Sdl
Terminology
Sdl 2
Program being compiled differently in 3 major C++ compilers. Which one is right?
C++
Language Lawyer
experimental::filesystem linker error
C++
Gcc
C++17
C++ execution order in method chaining
C++
Chaining
Operator Precedence
Why don't C++ compilers optimize this conditional boolean assignment as an unconditional assignment?
C++
Optimization
For loop inside its own curly braces
C++
For Loop
Scope
C++ - passing references to std::shared_ptr or boost::shared_ptr
C++
Boost
Pass by-Reference
Pass by-Value
Shared Ptr
Hand Coded GUI Versus Qt Designer GUI
C++
Qt
User Interface
Rad
Qt Designer
Why does the C++ map type argument require an empty constructor when using []?
C++
Dictionary
std::back_inserter for a std::set?
C++
Algorithm
Stl
In C++, if throw is an expression, what is its type?
C++
Throw
Downcasting shared_ptr<Base> to shared_ptr<Derived>?
C++
Gcc
Boost
opengl: glFlush() vs. glFinish()
C++
C
Opengl
Graphics
Unit testing of private methods
C++
Unit Testing
Private Methods
What is the meaning of "... ..." token? i.e. double ellipsis operator on parameter pack
C++
C++11
Variadic Templates
Variadic Functions
What differences, if any, between C++03 and C++11 can be detected at run-time?
C++
C++11
C++03
Language Detection
Why is there no std::stou?
C++
String
C++11
Std
Removing item from vector, while in C++11 range 'for' loop?
C++
Vector
For Loop
C++11
undefined reference to template function
C++
Qt
Boost
Undefined Reference
Function for C++ struct
C++
Function
Struct
Is it intended by the C++ standards committee that in C++11 unordered_map destroys what it inserts?
C++
Gcc
C++11
Clang
Standards
How do you clear a stringstream variable?
C++
Stringstream
Parse (split) a string in C++ using string delimiter (standard C++)
C++
Parsing
Split
Token
Tokenize
How do I execute a command and get the output of the command within C++ using POSIX?
C++
Process
Posix
System
Return Value
C++ auto& vs auto
C++
Auto
Placement of the asterisk in pointer declarations
C++
C
Pointers
Declaration
Using C++ library in C code
C++
C
Gcc
Glibc
Erasing elements from a vector
C++
Vector
Stl
Erase
Cannot find Dumpbin.exe
C#
C++
.Net
Visual Studio
Visual Studio-2005
C++: What is the size of an object of an empty class?
C++
Class
Object
Best practices for circular shift (rotate) operations in C++
C++
C
Rotation
Bit Manipulation
C++ Faq
Why not infer template parameter from constructor?
C++
Templates
Parameters
Inference
Weighted random numbers
C++
Boost
Random
Using continue in a switch statement
C++
C
Switch Statement
Break
Continue
Defining static const integer members in class definition
C++
Static
Declaration
Definition
How to disassemble a binary executable in Linux to get the assembly code?
C++
Linux
Assembly
Executable
Disassembly
C++ convert vector<int> to vector<double>
C++
Stl
Vector
Type Conversion
Why do objects of the same class have access to each other's private data?
C++
Private Members
How to specialize std::hash<Key>::operator() for user-defined type in unordered containers?
C++
Hash
C++11
Unordered Map
Unordered Set
Reason to Pass a Pointer by Reference in C++?
C++
Pointers
Reference
What exception classes are in the standard C++ library
C++
Exception
C++11
Stl
In C++, should I bother to cache variables, or let the compiler do the optimization? (Aliasing)
C++
Performance
Caching
Optimization
Strict Aliasing
How do I write a maintainable, fast, compile-time bit-mask in C++?
C++
C++11
Bit Manipulation
Hidden Features of C++?
C++
Hidden Features
C++ Object Instantiation
C++
Instantiation
Understanding the meaning of the term and the concept - RAII (Resource Acquisition is Initialization)
C++
Garbage Collection
Raii
Resource Management
Algorithm to convert RGB to HSV and HSV to RGB in range 0-255 for both
C++
C
Algorithm
How to overload the operator++ in two different ways for postfix a++ and prefix ++a?
C++
Operator Overloading
Initializing a member array in constructor initializer
C++
C++11
Initializer List
Ctor Initializer
Aggregate Initialization
Which one will execute faster, if (flag==0) or if (0==flag)?
C++
C
How to use doxygen to create UML class diagrams from C++ source
C++
Uml
Doxygen
Graphviz
Class Diagram
Stack Memory vs Heap Memory
C++
Memory
How does std::move() transfer values into RValues?
C++
C++11
Move Semantics
Benchmarking (python vs. c++ using BLAS) and (numpy)
C++
Python
Numpy
Benchmarking
Blas
Can I list-initialize a vector of move-only type?
C++
C++11
Initializer List
Move Semantics
Undefined reference to a static member
C++
Undefined Reference
Cross Compiling
How do I compile C++ with Clang?
C++
Clang
how to convert from int to char*?
C++
Integer
Const Char
Why explicitly delete the constructor instead of making it private?
C++
Does the C++ standard allow for an uninitialized bool to crash a program?
C++
Llvm
Undefined Behavior
Abi
Llvm Codegen
unsigned int vs. size_t
C++
C
Size T
Convert char to int in C and C++
C++
C
Gcc
Why is list initialization (using curly braces) better than the alternatives?
C++
C++11
Syntax
Initialization
List Initialization
Is ‘int main;’ a valid C/C++ program?
C++
C
Function
Main
Entry Point
Why is shared_ptr<void> legal, while unique_ptr<void> is ill-formed?
C++
Shared Ptr
Smart Pointers
Unique Ptr
Format Curly Braces on Same Line in C++ VSCode
C++
Format
Visual Studio-Code
Curly Braces
Using pre-compiled headers with CMake
C++
Visual Studio
Gcc
Cmake
Precompiled Headers
What should go into an .h file?
C++
Header Files
how do I initialize a float to its max/min value?
C++
Primitive Types
How to define several include path in Makefile
C++
Include
Makefile
C++ Tuple vs Struct
C++
Struct
Tuples
Random number generation in C++11: how to generate, how does it work?
C++
C++11
Random
C++ lambda with captures as a function pointer
C++
Lambda
Function Pointers
C++11
Will strlen be calculated multiple times if used in a loop condition?
C++
C
Gcc
Optimization
Strlen
Are Exceptions in C++ really slow
C++
C++98
How to pass parameters correctly?
C++
C++11
How is std::function implemented?
C++
C++11
Lambda
Why is it OK to return a 'vector' from a function?
C++
Vector
Stl
Scope
Standard Library
Is passing a C++ object into its own constructor legal?
C++
Class
Constructor
Language Lawyer
Undefined Behavior
How do I properly use std::string on UTF-8 in C++?
C++
String
C++11
C++20 behaviour breaking existing code with equality operator?
C++
C++17
C++20
Spaceship Operator
Are C++ enums signed or unsigned?
C++
Enums
What's the scope of the "using" declaration in C++?
C++
Run an Application in GDB Until an Exception Occurs
C++
Debugging
Gdb
Polymorphism
Multicore
How to Use CCache with CMake?
C++
Unix
Cmake
Ccache
C++ Modules - why were they removed from C++0x? Will they be back later on?
C++
C++11
Module
Standards
Language Extension
What is difference between instantiating an object using new vs. without
C++
Constructor
New Operator
Difference between std::pair and std::tuple with only two members?
C++
Visual Studio-2010
Tuples
Std Pair
Stdtuple
Dual emission of constructor symbols
C++
Gcc
Constructor
Abstract Class vs Interface in C++
C++
Interface
Abstract Class
How to iterate std::set?
C++
Set
Iteration
How to get duration, as int milli's and float seconds from <chrono>?
C++
C++11
Timer
Chrono
Array[n] vs Array[10] - Initializing array with variable vs numeric literal
C++
Arrays
Initialization
Size
Debug vs Release in CMake
C++
C
Gcc
Cmake
Which is faster: Stack allocation or Heap allocation
C++
Performance
Memory
Stack
Heap Memory
How can I avoid "for" loops with an "if" condition inside them with C++?
C++
C++11
C++14
Why is rand()%6 biased?
C++
Random
Std
What is __gxx_personality_v0 for?
C++
Gcc
Linker
Kernel
namespaces for enum types - best practices
C++
Enums
Scope
Nested
What does LPCWSTR stand for and how should it be handled with?
C++
Winapi
Lpcstr
std::map default value
C++
Stdmap
C++ catch blocks - catch exception by value or reference?
C++
Exception Handling
QString to char* conversion
C++
Qt
Qstring
Qtcore
How does virtual inheritance solve the "diamond" (multiple inheritance) ambiguity?
C++
Inheritance
Multiple Inheritance
Virtual Inheritance
Diamond Problem
How to specify preference of library path?
C++
Linker
G++
How to create a dynamic array of integers
C++
Implementing comparison operators via 'tuple' and 'tie', a good idea?
C++
C++11
Operators
Tuples
Strict Weak-Ordering
What is the difference between "Include Directories" and "Additional Include Directories"
C++
Visual Studio-2010
Visual Studio
Compilation
Recommended way to insert elements into map
C++
Stl
Stdmap
initializer_list and move semantics
C++
Templates
C++11
Move Semantics
Initializer List
Do ALL virtual functions need to be implemented in derived classes?
C++
Inheritance
Does std::string have a null terminator?
C++
String
Null
Member initialization while using delegated constructor
C++
Gcc
C++11
Ctor Initializer
Malloc vs new -- different padding
C++
Malloc
New Operator
Padding
C++11 emplace_back on vector<struct>?
C++
C++11
Why are preprocessor macros evil and what are the alternatives?
C++
C++11
C Preprocessor
error::make_unique is not a member of ‘std’
C++
C++11
Compiler Errors
C++14
Unique Ptr
How to avoid if / else if chain when classifying a heading into 8 directions?
C++
If Statement
Why use std::make_unique in C++17?
C++
C++17
Unique Ptr
Converting bool to text in C++
C++
String
Boolean
Why are C character literals ints instead of chars?
C++
C
Char
Sizeof
std::string to float or double
C++
Splitting templated C++ classes into .hpp/.cpp files--is it possible?
C++
Class
Templates
Header
Linker
Incrementing in C++ - When to use x++ or ++x?
C++
Post Increment
Pre Increment
Function pointer to member function
C++
Oop
Function Pointers
C++0x lambda capture by value always const?
C++
Lambda
Constants
C++11
How to write log base(2) in c/c++
C++
C
How to clear ostringstream
C++
Stream
How to fix GCC compilation error when compiling >2 GB of code?
C++
Math
Gcc
Compiler Errors
Code Size
In which order should floats be added to get the most precise result?
C++
Floating Point
Precision
What happens if I read a map's value where the key does not exist?
C++
Map
Why have header files and .cpp files?
C++
Header Files
GCC -fPIC option
C++
Gcc
Options
Fpic
Programmatically find the number of cores on a machine
C++
C
Multithreading
Multiplatform
Typedef function pointer?
C++
C
Pointers
Typedef
What are the main purposes of using std::forward and which problems it solves?
C++
C++11
Rvalue Reference
C++ Faq
Perfect Forwarding
How to find the intersection of two STL sets?
C++
Stl Algorithm
Stdset
What is the fastest integer division supporting division by zero no matter what the result is?
C++
C
Optimization
Divide by-Zero
How to fix the error "Windows SDK version 8.1" was not found?
C++
Visual Studio
Why is std::ssize() introduced in C++20?
C++
Stl
Unsigned
Signed
C++20
C++: what regex library should I use?
C++
Regex
Linux
How to calculate a time difference in C++
C++
What's the difference between std::string and std::basic_string? And why are both needed?
C++
Stl
Swapping two variable value without using third variable
C++
How to track down a "double free or corruption" error
C++
C
Debugging
Free
'uint32_t' identifier not found error
C++
C
Visual C++
What is the lifetime of the result of std::string::c_str()?
C++
String
C Strings
Lifetime
C Str
How can I clear console
C++
Windows
Console Application
Dev C++
The new keyword "auto"; When should it be used to declare a variable type?
C++
C++11
Auto
Type Safety
Is C notably faster than C++
C++
C
Performance
Is there a range class in C++11 for use with range based for loops?
C++
C++11
Range
Std
Ranged Loops
how to implement Interfaces in C++?
C++
Interface
Concept
How to overcome "'aclocal-1.15' is missing on your system" warning?
C++
Github
Makefile
Automake
Does C++20 mandate source code being stored in files?
C++
Language Lawyer
C++20
Std Source-Location
Which is the best Linux C/C++ debugger (or front-end to gdb) to help teaching programming?
C++
Linux
Debugging
What's the best way to do a backwards loop in C/C#/C++?
C#
C++
C
Generate random numbers uniformly over an entire range
C++
Random
Why do I get "unresolved external symbol" errors when using templates?
C++
Templates
Linker
What is a handle in C++?
C++
Handle
Removing leading and trailing spaces from a string
C++
String
Compile time string hashing
C++
Metaprogramming
C++11
Hash
Fixed-size floating point types
C++
C
Boost
Floating Point
Convert an int to a QString with zero padding (leading zeroes)
C++
Qt
Qstring
What is the difference between a const reference and normal parameter?
C++
Parameters
Reference
Constants
Where is shared_ptr?
C++
Boost
C++11
Shared Ptr
Smart Pointers
In C++, is it still bad practice to return a vector from a function?
C++
C++11
Coding Style
Return Value-Optimization
C++: Print out enum value as text
C++
Enums
How do I check for C++11 support?
C++
C++11
M_PI works with math.h but not with cmath in Visual Studio
C++
Visual Studio
Visual Studio-2010
The tilde operator in C
C++
C
Operators
When to use std::begin and std::end instead of container specific versions
C++
C++11
Using emit vs calling a signal as if it's a regular function in Qt
C++
Qt
How to disallow temporaries
C++
error: request for member '..' in '..' which is of non-class type
C++
How to get position of a certain element in strings vector, to use it as an index in ints vector?
C++
should use size_t or ssize_t
C++
Unsigned
Signed
Size T
When do I really need to use atomic<bool> instead of bool?
C++
C++11
Atomic
Stdatomic
Why is argc not a constant?
C++
Constants
Main
Argc
Effective C++
Faster code-completion with clang
C++
Clang
Llvm
Code Completion
Libclang
C++ How do I convert a std::chrono::time_point to long and back
C++
C++11
Chrono
What makes this usage of pointers unpredictable?
C++
Pointers
std::ignore with structured bindings?
C++
C++17
Language Lawyer
Structured Bindings
Std Tie
Why does code mutating a shared variable across threads apparently NOT suffer from a race condition?
C++
Race Condition
Why does std::set not have a "contains" member function?
C++
Stl
Stdset
Why doesn't a simple "Hello World"-style program compile with Turbo C++?
C++
Turbo C++
C++ Faq
Why is std::is_pod deprecated in C++20?
C++
Typetraits
What is the need of template lambda introduced in C++20 when C++14 already has generic lambda?
C++
C++14
C++20
Generic Lambda
Unicode Processing in C++
C++
Unicode
Using CMake to generate Visual Studio C++ project files
C++
Visual Studio
Build Process
Cross Platform
Cmake
Convert a vector<int> to a string
C++
Vector
Tostring
how to append a list<T> object to another
C++
List
Stl
(How) can I count the items in an enum?
C++
Count
Enumeration
How do I find where an exception was thrown in C++?
C++
Debugging
Exception Handling
Compiler error: memset was not declared in this scope
C++
Gcc
Difference between std::result_of and decltype
C++
C++11
Decltype
Result Of
How to construct a c++ fstream from a POSIX file descriptor?
C++
Posix
Fstream
File Descriptor
Order of evaluation in C++ function parameters
C++
Standards
Does Qt support virtual pure slots?
C++
Qt
Inheritance
Signals Slots
bool operator ++ and --
C++
Boolean
Increment
Do rvalue references to const have any use?
C++
C++11
Constants
Rvalue Reference
C++ Const Usage Explanation
C++
Constants
How to set std::tuple element by index?
C++
Templates
Indexing
Tuples
What is the simplest way to convert array to vector?
C++
Arrays
Vector
Qt c++ aggregate 'std::stringstream ss' has incomplete type and cannot be defined
C++
String
Qt
Stringstream
Initial capacity of vector in C++
C++
Memory Management
Stl
Vector
Difference between C++03 throw() specifier C++11 noexcept
C++
Exception
C++11
Throw
Noexcept
Visual C++ 2008 Express Download Link Dead?
C++
Ide
Download
What is the significance of initializing direction arrays below with given values when developing chess program?
C++
C
Chess
Resolving ambiguous overload on function pointer and std::function for a lambda using + (unary plus)
C++
C++11
Lambda
Overloading
Can I implement an autonomous `self` member type in C++?
C++
C++11
Why is 'pure polymorphism' preferable over using RTTI?
C++
Polymorphism
Rtti
How does guaranteed copy elision work?
C++
C++17
Copy Elision
(A + B + C) ≠ (A + C + B) and compiler reordering
C++
C
Compiler Construction
Integer Overflow
Is it legal to index into a struct?
C++
C
Struct
Timer function to provide time in nano seconds using C++
C++
C
Timer
Where does Visual Studio look for C++ header files?
C++
Visual Studio
Header
How do I print to the debug output window in a Win32 app?
C++
Visual Studio
Winapi
Visual Studio-2005
Console
Comparison of arrays in google test?
C++
Unit Testing
Googletest
The written versions of the logical operators
C++
Language Features
Logical Operators
What is the meaning of "operator bool() const"
C++
Operators
Implicit Conversion
Conversion Operator
How to remove certain characters from a string in C++?
C++
String
Character
What is an unsigned char?
C++
C
Char
What is the most effective way to get the index of an iterator of an std::vector?
C++
Iterator
Coding Style
C++ function template partial specialization?
C++
Templates
Template Specialization
Partial Specialization
gcc/g++: "No such file or directory"
C++
C
Gcc
G++
C++ Faq
How can I initialize C++ object member variables in the constructor?
C++
Constructor
Class Members
Object Construction
Difference between std::system_clock and std::steady_clock?
C++
C++11
Timer
Chrono
<cstdint> vs <stdint.h>
C++
Stdint
Cstdint
How to send custom message in Google C++ Testing Framework?
C++
Googletest
use std::fill to populate vector with increasing numbers
C++
Stl
Convert float to string with precision & number of decimal digits specified?
C++
String
Floating Point
What are the evaluation order guarantees introduced by C++17?
C++
C++17
Operator Precedence
Why is a segmentation fault not recoverable?
C++
C
Exception
Segmentation Fault
Guaranteed lifetime of temporary in C++?
C++
Are static fields inherited?
C++
Inheritance
Static
What are practical uses of a protected constructor?
C++
Constructor
Protected
fastest (low latency) method for Inter Process Communication between Java and C/C++
Java
C++
Performance
Ipc
Latency
What is the fastest way to compute sin and cos together?
C#
C++
C
Algorithm
Math
'do...while' vs. 'while'
C#
C++
C
While Loop
Do While
Qt events and signal/slots
C++
Qt
Why an unnamed namespace is a "superior" alternative to static?
C++
Namespaces
Standards
Iso
Why would we call cin.clear() and cin.ignore() after reading input?
C++
Input
Iostream
Cin
Does C++11 have C#-style properties?
C#
C++
Class
C++11
What is a void pointer in C++?
C++
Void Pointers
Is using assert() in C++ bad practice?
C++
Coding Style
Assert
C++11 lambda implementation and memory model
C++
Memory
Lambda
C++11
Is gcc 4.8 or earlier buggy about regular expressions?
C++
Regex
Gcc
C++11
Libstdc++
Linking libstdc++ statically: any gotchas?
C++
Linux
Gcc
Static Libraries
Libstdc++
Is there a non-atomic equivalent of std::shared_ptr? And why isn't there one in <memory>?
C++
C++11
Smart Pointers
Access private field of another object in same class
Java
C++
.Net
Oop
Why is it impossible to build a compiler that can determine if a C++ function will change the value of a particular variable?
C++
Compiler Construction
Determining if a number is either a multiple of ten or within a particular set of ranges
C++
Comparison
Conditional Statements
Integer Arithmetic
Lambda implicit capture fails with variable declared from structured binding
C++
Lambda
Visual Studio-2017
C++17
Structured Bindings
Why does std::stack use std::deque by default?
C++
Stl
Containers
C++ #include and #import difference
C++
Visual C++
Gcc
Import
Include
When should you not use virtual destructors?
C++
Virtual Functions
Virtual Destructor
Safely override C++ virtual functions
C++
Overriding
Virtual Functions
Maven-like dependency management for C++?
C++
Maven
Build
Dependency Management
How to use base class's constructors and assignment operator in C++?
C++
Inheritance
Constructor
Assignment Operator
Which STL container should I use for a FIFO?
C++
Stl
Fifo
How do I Search/Find and Replace in a standard string?
C++
Replace
Std
Should I inherit from std::exception?
C++
Exception
Exception Handling
C++ multiline string literal
C++
String Literals
Why should casting be avoided?
C#
Java
C++
Casting
When to use the brace-enclosed initializer?
C++
C++11
Initializer List
Why is stack memory size so limited?
C++
Memory Management
NumPy style arrays for C++?
C++
Arrays
Python 3.x
Numpy
Dynamic Arrays
Efficient unsigned-to-signed cast avoiding implementation-defined behavior
C++
Casting
Integer
Language Lawyer
Integer Overflow
Deleting a pointer in C++
C++
Pointers
Delete Operator
Make a program run slowly
C++
C
Linux
Unix
Ubuntu
How can a C++ header file include implementation?
C++
Header Files
Call a C function from C++ code
C++
C
Linux
Extern C
Why can't I compile an unordered_map with a pair as key?
C++
Dictionary
Unordered Map
Keyvaluepair
Why does everybody typedef over standard C types?
C++
C
Stdint
What is the difference between chrono::month and chrono::months
C++
C++20
Chrono
How to set breakpoints on future shared libraries with a command flag
C++
C
Linux
Unix
Gdb
What does extern inline do?
C++
C
Extern
Inline Functions
How do I put two increment statements in a C++ 'for' loop?
C++
For Loop
Comma Operator
Compiling a C++ program with GCC
C++
Gcc
G++
Gnu
Can const-correctness improve performance?
C++
Performance
Const Correctness
Does making a struct volatile make all its members volatile?
C++
Magic number in boost::hash_combine
C++
Algorithm
Boost
Hash
Magic Numbers
How can I create my own comparator for a map?
C++
Stl
Stdmap
How to get a certain element in a list, given the position?
C++
List
Stl
Which is faster : if (bool) or if(int)?
C++
Assembly
Int
Boolean
What does && mean in void *p = &&abc;
C++
C
Gcc
Operators
How to get integer thread id in c++11
C++
Multithreading
C++11
How to enforce move semantics when a vector grows?
C++
Vector
C++11
Resize
Move Semantics
Get a file name from a path
C++
Visual C++
Dynamically load a function from a DLL
C++
Winapi
Dll
Overriding non-virtual methods
C++
Overriding
Reference member variables as class members
C++
Reference
Is C++14 adding new keywords to C++?
C++
C++11
Keyword
C++14
Compiler showing 'pi' symbol on error
C++
Coliru
Does "Undefined Behavior" really permit *anything* to happen?
C++
C
Language Lawyer
Undefined Behavior
C++ Difference between std::ref(T) and T&?
C++
Reference
Ref
When to use extern in C++
C++
Variable Declaration
How do I use arrays in C++?
C++
Arrays
Pointers
Multidimensional Array
C++ Faq
Static constant string (class member)
C++
String
Class
Static
Constants
What is the difference between float and double?
C++
C
Floating Point
Precision
Ieee 754
error: passing xxx as 'this' argument of xxx discards qualifiers
C++
Initializing a static std::map<int, int> in C++
C++
Stl
Stdmap
Why is there no support for concatenating std::string and std::string_view?
C++
String
C++17
String View
Prevent function taking const std::string& from accepting 0
C++
String
Std
Implicit Conversion
Have there ever been silent behavior changes in C++ with new standard versions?
C++
Language Lawyer
Standardization
std::map insert or std::map find?
C++
Optimization
Stl
Stdmap
Visual Studio support for new C / C++ standards?
C++
Visual Studio
Visual C++
C++11
C99
What’s the best way to check if a file exists in C++? (cross platform)
C++
File
File Io
Inspecting standard container (std::map) contents with gdb
C++
Stl
Map
Gdb
C++ obtaining milliseconds time on Linux -- clock() doesn't seem to work properly
C++
Timer
Clock
minimum double value in C/C++
C++
C
Math
What does a colon following a C++ constructor name do?
C++
Constructor
Initialization List
Ctor Initializer
When do I use fabs and when is it sufficient to use std::abs?
C++
math.h
Cmath
Confusing Template error
C++
Templates
Llvm
Clang
Why can I access private variables in the copy constructor?
C++
Private
Access Specifier
delete vs delete[]
C++
Memory Management
Delete Operator
How to update std::map after using the find method?
C++
Map
Stl
Stdmap
C/C++ with GCC: Statically add resource files to executable/library
C++
Linux
Gcc
Shared Libraries
Elf
C++: Where to initialize variables in constructor
C++
Constructor
Initialization
What causes signal 'SIGILL'?
Android
C++
Android Ndk
Porting
What is a subnormal floating point number?
C++
C++11
Floating Point
Ieee 754
Function declaration inside or outside the class
C++
Inline
C++: Namespaces -- How to use in header and source files correctly?
C++
Namespaces
Header Files
Should the trailing return type syntax style become the default for new C++11 programs?
C++
C++11
Auto
Trailing Return-Type
Is gcc std::unordered_map implementation slow? If so - why?
C++
Stl
C++11
Hashmap
Concurrenthashmap
Is it possible to determine the number of elements of a c++ enum class?
C++
C++11
Cardinality
Enum Class
Why does string::compare return an int?
C++
How to write std::string to file?
C++
Why do we copy then move?
C++
C++11
Move Semantics
What does it mean to "ODR-use" something?
C++
Templates
One Definition-Rule
What are template deduction guides and when should we use them?
C++
Templates
C++17
C++ Faq
Template Argument-Deduction
How to enable C++17 in CMake
C++
Visual Studio
Cmake
C++17
How can I test whether a number is a power of 2?
C++
Algorithm
Bit Manipulation
Program only crashes as release build -- how to debug?
C++
Debugging
Why do people use __ (double underscore) so much in C++
C++
Syntax
How do I check if an object's type is a particular subclass in C++?
C++
Class
Subclass
Identification
How do you serialize an object in C++?
C++
Serialization
Marshalling
C++ Faq
Alternative to vector<bool>
C++
Stl
Vector
Boolean
ACE vs Boost vs POCO
C++
Boost
Poco Libraries
Ace
Why isn't the [] operator const for STL maps?
C++
Constants
Clean code to printf size_t in C++ (or: Nearest equivalent of C99's %z in C++)
C++
Printf
Size T
How to use QueryPerformanceCounter?
C++
Windows
Timer
Why can't we declare a std::vector<AbstractClass>?
C++
Stl
Abstract Class
Why does C++ disallow anonymous structs?
C++
Struct
Unions
What does "-Wall" in "g++ -Wall test.cpp -o test" do?
C++
G++
Memory management in Qt?
C++
Qt
Memory
Object
Static array vs. dynamic array in C++
C++
Dynamic
Arrays
Static
Allocation
Register keyword in C++
C++
How did this person code "Hello World" with Microsoft Paint?
C++
C
Paint
How to implode a vector of strings into a string (the elegant way)
C++
String
Stl
Stdstring
Implode
How to build a full path string (safely) from separate strings?
C++
Qt
Filepath
Why does C++ require a user-provided default constructor to default-construct a const object?
C++
How to check if a std::thread is still running?
C++
Multithreading
C++11
Stdthread
In std::multiset is there a function or algorithm to erase just one sample (unicate or duplicate) if an element is found
C++
Stl
Multiset
C++11 introduced a standardized memory model. What does it mean? And how is it going to affect C++ programming?
C++
Multithreading
C++11
Language Lawyer
Memory Model
Why can templates only be implemented in the header file?
C++
Templates
Undefined Reference
C++ Faq
Why is reading lines from stdin much slower in C++ than Python?
Python
C++
Benchmarking
Iostream
Getline
What is a smart pointer and when should I use one?
C++
Pointers
C++11
Smart Pointers
C++ Faq
How can I profile C++ code running on Linux?
C++
Linux
Profiling
What is the effect of extern "C" in C++?
C++
C
Linkage
Name Mangling
Extern C
What is move semantics?
C++
C++ Faq
C++11
Move Semantics
Why is splitting a string slower in C++ than Python?
C++
Python
String
Split
Benchmarking
operator << must take exactly one argument
C++
Operator Overloading
Iostream
Get the status of a std::future
C++
Multithreading
C++11
Future
curl.h no such file or directory
C++
Curl
Why sizeof int is wrong, while sizeof(int) is right?
C++
C
Sizeof
C++ Boost: undefined reference to boost::system::generic_category()
C++
Linux
Boost
Codeblocks
Why isn't std::initializer_list a language built-in?
C++
C++11
Std
Initializer List
Undefined reference to static variable c++
C++
Static
How to record webcam and audio using webRTC and a server-based Peer connection
Javascript
C++
Video Streaming
Webrtc
Audio Streaming
What are the rules for the "..." token in the context of variadic templates?
C++
C++11
Variadic Templates
Using {} in a case statement. Why?
C++
Switch Statement
Unions and type-punning
C++
C
Unions
Type Punning
Explicit constructor taking multiple arguments
C++
Explicit Constructor
How should I detect unnecessary #include files in a large C++ project?
C++
Visual Studio-2008
Include
Header
Dependencies
Converting a pointer into an integer
C++
Gcc
Casting
64 Bit
32 Bit
What is the difference between C++ and Visual C++?
C++
Visual C++
Should I use double or float?
C++
Types
Floating Point
Double Precision
Unsigned keyword in C++
C++
Unsigned
How to use glOrtho() in OpenGL?
C++
C
Opengl
Example of UUID generation using Boost in C++
C++
Boost
Uuid
Boost Uuid
Why is auto_ptr being deprecated?
C++
C++11
Smart Pointers
Auto Ptr
long long int vs. long int vs. int64_t in C++
C++
Gcc
Cstdint
Error: free(): invalid next size (fast):
C++
G++
Proper way to initialize C++ structs
C++
Struct
Initialization
Valgrind
Calloc
Why is "using namespace X;" not allowed at class/struct level?
C++
Namespaces
Using
Language Lawyer
Correct way of declaring pointer variables in C/C++
C++
C
Pointers
Coding Style
C++ - Why static member function can't be created with 'const' qualifier
C++
Static
Language Lawyer
Const Method
What's the difference between std::multimap<key, value> and std::map<key, std::set<value> >
C++
Map
Containers
Key Value
Multimap
How to compare pointers?
C++
Pointers
Should C++ function default argument values be specified in headers or .cpp source files?
C++
Header
How to use Macro argument as string literal?
C++
C Preprocessor
String Literals
What is the correct answer for cout << a++ << a;?
C++
C++ Faq
What is a “memory stomp”?
C++
C
Memory
Memory Management
Confused when boost::asio::io_service run method blocks/unblocks
C++
Boost Asio
What are the differences between concepts and template constraints?
C++
C++11
D
C++ Concepts
Why can't I capture this by-reference ('&this') in lambda?
C++
C++11
Lambda
Non const lvalue references
C++
0.1 float is greater than 0.1 double. I expected it to be false
C++
C
Floating Point
Double
Rounding
Is "else if" a single keyword?
C++
Syntax
Language Lawyer
Understanding std::atomic::compare_exchange_weak() in C++11
C++
Multithreading
C++11
Atomic
Does unique_ptr::release() call the destructor?
C++
Unique Ptr
How should I deal with mutexes in movable types in C++?
C++
Mutex
Move Constructor
What does [=] mean in C++?
C++
C++11
Lambda
C++ warning: division of double by zero
C++
Gcc
Floating Point
Divide by-Zero
How to get the file size in bytes with C++17
C++
C++17
Filesize
C++ Standard-Library
Is using malloc for int undefined behavior until C++20
C++
Malloc
Undefined Behavior
C++20
How to read a value from the Windows registry
C++
Windows
Winapi
Registry
How do you construct a std::string with an embedded null?
C++
Null
Stdstring
Why does GCC generate 15-20% faster code if I optimize for size instead of speed?
C++
Performance
Gcc
X86 64
Compiler Optimization
C++11 rvalues and move semantics confusion (return statement)
C++
C++11
Move Semantics
Rvalue Reference
C++ Faq
enum to string in modern C++11 / C++14 / C++17 and future C++20
C++
String
Enums
C++17
C++20
Iteration over std::vector: unsigned vs signed index variable
C++
Stl
Unsigned
Signed
What's the difference between "STL" and "C++ Standard Library"?
C++
Stl
Std
C++ Standard-Library
C++ Faq
How does the compilation/linking process work?
C++
Compiler Construction
Linker
C++ Faq
Deleting a pointer to const (T const*)
C++
Constants
Delete Operator
Is Python faster and lighter than C++?
C++
Python
Performance
Memory
Statistics
Is it safe to delete a void pointer?
C++
Memory Management
Casting
Void Pointers
How to catch segmentation fault in Linux?
C++
Segmentation Fault
Try Catch
What is the point of function pointers?
C++
C
Function
Pointers
C++ Faq
stdcall and cdecl
C++
Stdcall
Cdecl
Floating point division vs floating point multiplication
C++
Floating Point
Micro Optimization
Function returning a lambda expression
C++
Function
C++11
Lambda
Initialize static variables in C++ class?
C++
Static
Initialization
What are the different versions of exec used for in C and C++?
C++
C
Exec
Is it still safe to delete nullptr in c++0x?
C++
Null
Language Lawyer
Delete Operator
Can a pointer to base point to an array of derived objects?
C++
Pointers
Calculate mean and standard deviation from a vector of samples in C++ using Boost
C++
Algorithm
Boost
Statistics
Mean
what does __declspec(dllimport) really mean?
C++
Qt
Visual C++
Dll
Declspec
C++11: Number of Variadic Template Function Parameters?
C++
C++11
Variadic Templates
Variadic Functions
How to set up googleTest as a shared library on Linux
C++
Linux
Unit Testing
Installation
Googletest
How does std::flush work?
C++
Stream
C++ callback using class member
C++
Function
Callback
Member
What's the difference between span and array_view in the gsl library?
C++
Cpp Core-Guidelines
Guideline Support-Library
Array View
How to efficiently get a `string_view` for a substring of `std::string`
C++
View
C++17
Stdstring
Why can a T* be passed in register, but a unique_ptr<T> cannot?
C++
Assembly
Unique Ptr
Calling Convention
Abi
Precompiled headers with GCC
C++
Gcc
Precompiled Headers
How can I get the IP address of a (Linux) machine?
C++
Linux
Networking
Ip Address
How to programmatically cause a core dump in C/C++
C++
C
Linux
Coredump
Abort
Techniques for obscuring sensitive strings in C++
C++
Security
Obfuscation
Defensive Programming
Read file-contents into a string in C++
C++
String
File Io
How can I use cout << myclass
C++
Class
Input
Integer
Why does C++ not allow inherited friendship?
C++
Inheritance
Language Design
Friend
How does the Import Library work? Details?
C++
C
Windows
Visual C++
Operator[][] overload
C++
Operator Overloading
resetting a stringstream
C++
String
Stringstream
Creating a C++ namespace in header and source (cpp)
C++
Namespaces
Passing shared pointers as arguments
C++
C++11
Shared Ptr
C++ Faq
How to read a file line by line or a whole text file at once?
C++
Iostream
Fstream
File Handling
How to choose between map and unordered_map?
C++
Dictionary
Data Structures
Stl
Unordered Map
Direct way of computing clockwise angle between 2 vectors
C++
Math
Angle
What exactly is the "as-if" rule?
C++
C
Optimization
C++ Faq
As If
Memory alignment : how to use alignof / alignas?
C++
C++11
X86 64
Memory Alignment
Use of 'const' for function parameters
C++
Constants
What uses are there for "placement new"?
C++
Memory Management
New Operator
Placement New
When to use dynamic vs. static libraries
C++
Dll
Shared Libraries
Static Linking
Dynamic Linking
What is the meaning of prepended double colon "::"?
C++
Syntax
Namespaces
Scope Resolution
Global Namespace
Clean ways to write multiple 'for' loops
C++
For Loop
Computing length of a C string at compile time. Is this really a constexpr?
C++
C++11
Standards
Constexpr
String Literals
How can a program with a global variable called main instead of a main function work?
C++
Main
Language Lawyer
Why is assigning a value to a bit field not giving the same value back?
C++
C
Bit Fields
Signed Integer
Implementation Defined-Behavior
Encode/Decode URLs in C++
C++
Urlencode
Urldecode
Percent Encoding
What is COM (Component Object Model) in a nutshell?
C++
Com
Testing pointers for validity (C/C++)
C++
C
Validation
Pointers
Null
How to get memory usage at runtime using C++?
C++
Linux
Memory Management
Why can I define structures and classes within a function in C++?
C++
Data Structures
Functional Programming
Template specialization of a single method from a templated class
C++
Visual Studio-2008
Templates
Specialization
Return a "NULL" object if search result not found
C++
Return Value
Sentinel
How to call C++ function from C?
C++
C
Visual C++
Extern C
What would a std::map extended initializer list look like?
C++
C++11
Dictionary
Initializer List
Splitting a C++ std::string using tokens, e.g. ";"
C++
Calling a java method from c++ in Android
Java
C++
Android
Java Native-Interface
Android Ndk
How to Generate a calling graph for C++ code
C++
Static Analysis
Call Graph
Non-type template parameters
C++
Templates
Difference between function arguments declared with & and * in C++
C++
Function
Pointers
Pass by-Reference
Efficiency of premature return in a function
C#
Java
C++
C
Compiler Optimization
Sorting Characters Of A C++ String
C++
String
Sorting
What is the difference between QImage and QPixmap?
C++
Qt
Qimage
Qpixmap
Multi line preprocessor macros
C++
C
C Preprocessor
Should arrays be used in C++?
C++
Arrays
Conventions
Set QLineEdit to accept only numbers
C++
Qt
Qlineedit
Do I have to acquire lock before calling condition_variable.notify_one()?
C++
Multithreading
Condition Variable
Are C++11 thread_local variables automatically static?
C++
C++11
Thread Local-Storage
The differences between initialize, define, declare a variable
C++
C
Terminology
Why is there no transform_if in the C++ standard library?
C++
C++ Standard-Library
Stl Algorithm
Catching access violation exceptions?
C++
Exception Handling
Copy map values to vector in STL
C++
Stl
Containers
What is the difference between a template class and a class template?
C++
Why is NULL undeclared?
C++
Syntax
Nodes
How to simulate "Press any key to continue?"
C++
What is Linux’s native GUI API?
C++
C
Linux
User Interface
How do you get assembler output from C/C++ source in gcc?
C++
C
Assembly
Gcc
Disassembly
What are the differences between struct and class in C++?
C++
Oop
Class
Struct
C++ Faq
How do I combine hash values in C++0x?
C++
C++11
Boost
Hash
Std
How to declare a function that accepts a lambda?
C++
Lambda
C++11
Getting a directory name from a filename
C++
File
Directory
How to view symbols in object files?
C++
Linux
G++
Object Files
Deprecation of the static keyword... no more?
C++
Static
C++11
Standards
What does OpenCV's cvWaitKey( ) function do?
C++
C
Opencv
explicit specialization of template class member function
C++
Templates
Gcc
Specialization
In C++ check if std::vector<string> contains a certain value
C++
Vector
Std
Stdvector
Expression must have class type
C++
Class
New Operator
GNU GCC (g++): Why does it generate multiple dtors?
C++
G++
Destructor
Will using goto leak variables?
C++
Goto
Why can't I create a vector of lambdas (of the same type) in C++11?
C++
Vector
Lambda
C++11
fatal error LNK1104: cannot open file 'libboost_system-vc110-mt-gd-1_51.lib'
C++
Visual Studio
Boost
cc1plus: error: unrecognized command line option "-std=c++11" with g++
C++
C++11
Compiler Errors
G++
Std
How does the main() method work in C?
C++
C
Is there 'byte' data type in C++?
C++
C++ - Decimal to binary converting
C++
Binary
Decimal
OpenCV Point(x,y) represent (column,row) or (row,column)
C++
Opencv
How do I add a library path in cmake?
C++
Cmake
Why is memmove faster than memcpy?
C++
C
Performance
Memory
What does it mean to "poison a function" in C++?
C++
Constexpr
When is a private constructor not a private constructor?
C++
C++11
Language Lawyer
Default Constructor
Aggregate Initialization
Can a declaration affect the std namespace?
C++
Std
Reserved
What's the purpose of using a union with only one member?
C++
C++14
Unions
Open source PDF library for C/C++ application?
C++
C
Pdf
Open Source
How to read until EOF from cin in C++
C++
Input
Iostream
Is const_cast safe?
C++
Casting
Const Cast
Function with same name but different signature in derived class
C++
Function
Inheritance
Lookup
C++ Faq
Possible to call C++ code from C#?
C#
.Net
C++
Unmanaged
Managed
Why catch an exception as reference-to-const?
C++
Exception
Constants
c++ deque vs queue vs stack
C++
Containers
shared_ptr magic :)
C++
Destructor
Smart Pointers
Detecting signed overflow in C/C++
C++
C
Undefined Behavior
Signed
Integer Overflow
c++ parse int from string
C++
String
Int
How to redirect qDebug, qWarning, qCritical etc output?
C++
Debugging
Qt
Mingw
Qdebug
C++ equivalent of sprintf?
C++
Printf
How to convert string to IP address and vice versa
C++
String
Struct
Ip Address
In Addr
Signed/unsigned comparisons
C++
Visual Studio-2005
Comparison
Unsigned
Signed
Right way to split an std::string into a vector<string>
C++
String
How to use std::sort to sort an array in C++
C++
Sorting
error: invalid initialization of non-const reference of type ‘int&’ from an rvalue of type ‘int’
C++
Pointers
Reference
libstdc++.so.6: cannot open shared object file: No such file or directory
C++
Cilk
Cilk Plus
How to copy contents of a directory into build directory after make with CMake?
C++
Cmake
Is there a standard sign function (signum, sgn) in C/C++?
C++
C
Math
Why do we use volatile keyword?
C++
Volatile
Compiler Optimization
Undefined reference to vtable
C++
Gcc
G++
Why do C++11-deleted functions participate in overload resolution?
C++
C++11
How can I sort two vectors in the same way, with criteria that uses only one of the vectors?
C++
C++11
How to build native C++ apps with HTML/CSS UI?
C++
Html
Css
User Interface
Desktop Application
Is multiplication faster than float division?
C++
C
Performance
Optimization
Compilation fails with "relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object"
C++
Linux
Gcc
Linker
Shared Libraries
Compiling multithread code with g++
C++
Linux
Ubuntu
Gcc
G++
Can I download the Visual C++ Command Line Compiler without Visual Studio?
C++
Winapi
Visual C++
What's the closest double to 1.0, that isn't 1.0?
C++
Floating Point
Floating Accuracy
Why is ++x a lvalue and x++ a rvalue?
C++
C++11
Would replacing ' :: ' with ' . ' create ambiguities in C++?
C++
Language Design
How to set up unit testing for Visual Studio C++
C++
Unit Testing
Testing
Visual Studio-2008
Frameworks
When do function-level static variables get allocated/initialized?
C++
Variables
What does the question mark character ('?') mean in C++?
C++
Operators
Conditional Operator
Sleep function in C++
C++
Why is the size of an empty class in C++ not zero?
C++
Sizeof
LLVM C++ IDE for Windows
C++
Windows
Ide
Llvm
Clang
map<int,int> default values
C++
Dictionary
Default
How do you 'realloc' in C++?
C++
New Operator
Realloc
Delete Operator
How to initialize a static const member in C++?
C++
Static
Searching in a sorted and rotated array
C++
C
Arrays
Algorithm
does `const auto` have any meaning?
C++
C++11
Constants
C++11 features in Visual Studio 2012
C++
Visual C++
C++11
Visual C++-2012
Operator new initializes memory to zero
C++
Memory Management
std::thread calling method of class
C++
Multithreading
C++11
How to pass std::unique_ptr around?
C++
C++11
Unique Ptr
Define constant variables in C++ header
C++
Header
Constants
How to display a progress indicator in pure C/C++ (cout/printf)?
C++
C
User Interface
C++11
Io
How to store variadic template arguments?
C++
C++11
Variadic Templates
unique_ptr to a derived class as an argument to a function that takes a unique_ptr to a base class
C++
Visual Studio-2012
C++11
Unique Ptr
When do extra parentheses have an effect, other than on operator precedence?
C++
C++11
Language Lawyer
Parentheses
C++ Faq
Does this code from "The C++ Programming Language" 4th edition section 36.3.6 have well-defined behavior?
C++
C++11
Language Lawyer
Operator Precedence
Unspecified Behavior
How does the JPEG of Death vulnerability operate?
C++
Security
Memcpy
Malware
Default, value and zero initialization mess
C++
C++11
C++14
C++03
C++98
Is it possible to differentiate between 0 and -0?
C++
Int
Zero
Negative Number
Interacting with C++ classes from Swift
C++
Swift
Static linking vs dynamic linking
C++
C
Performance
Static Linking
Dynamic Linking
Why is this program erroneously rejected by three C++ compilers?
C++
Visual C++
Compiler Errors
Clang
What are copy elision and return value optimization?
C++
Optimization
C++ Faq
Return Value-Optimization
Copy Elision
Is there any advantage of using map over unordered_map in case of trivial keys?
C++
Performance
Dictionary
Unordered Map
How many levels of pointers can we have?
C++
C
Pointers
Language Lawyer
Limit
'printf' vs. 'cout' in C++
C++
Printf
Iostream
Cout
Stdio
Why do (only) some compilers use the same address for identical string literals?
C++
Language Lawyer
String Literals
String Interning
How do I create a "spacer" in a C++ class memory structure?
C++
C
Memory Management
Low Level
Bare Metal
Does an unused member variable take up memory?
C++
Memory
Struct
Variable declarations in header files - static or not?
C++
C
Static
Detecting CPU architecture compile-time
C++
C
Detection
Cpu Architecture
Compile Time
Base64 decode snippet in C++
C++
Base64
I've heard i++ isn't thread safe, is ++i thread-safe?
C++
C
Multithreading
WTF does WTF represent in the WebKit code base?
C++
Webkit
Chromium
C++ Get name of type in template
C++
Templates
Compile Time
Typename
C/C++: Force Bit Field Order and Alignment
C++
C
Bit Manipulation
Endianness
Bit
Uses of C comma operator
C++
C
Comma Operator
Copy constructor and = operator overload in C++: is a common function possible?
C++
Variable Assignment
Copy Constructor
C++ Faq
generate random double numbers in c++
C++
Random
When do we have to use copy constructors?
C++
Copy Constructor
In this specific case, is there a difference between using a member initializer list and assigning values in a constructor?
C++
Initialization
Initialization List
Getting std :: ifstream to handle LF, CR, and CRLF?
C++
Ifstream
Newline
Pretty-print std::tuple
C++
C++11
Tuples
Variadic Templates
how to provide a swap function for my class?
C++
Stl
Swap
Can #if pre-processor directives be nested in C++?
C++
C Preprocessor
Preprocessor Directive
Random number c++ in some range
C++
Random
How can I change the variable to which a C++ reference refers?
C++
Reference
Dynamic Rebinding
Why are memcpy() and memmove() faster than pointer increments?
C++
C
Loops
How does the range-based for work for plain arrays?
C++
Arrays
Foreach
C++11
"\n" or '\n' or std::endl to std::cout?
C++
String
Character
Isn't "const" redundant when passing by value?
C++
Constants
Pass by-Value
Reusing a moved container?
C++
C++11
Move Semantics
conversion from derived * to base * exists but is inaccessible
C++
Inheritance
What's the result of += in C and C++?
C++
C
Default member values best practice
C++
Constructor
C++11
Header Files
Default Value
C++11 allows in-class initialization of non-static and non-const members. What changed?
C++
Class
C++11
Initialization
Class Members
Why shouldn't an Android app be written in C/C++ because you "simply prefer to program in C/C++"?
Java
Android
C++
How to read a binary file into a vector of unsigned chars
C++
File Io
Vector
Binaryfiles
How to make a conditional typedef in C++
C++
C++11
What is the purpose of std::function, and how to use it?
C++
C++11
Lambda
Function Pointers
Std Function
Why is libc++'s vector<bool>::const_reference not bool?
C++
Vector
C++ Standard-Library
Libc++
Std Bitset
Why does a lambda have a size of 1 byte?
C++
C++11
Lambda
C++14
Sizeof
Visual Studio Code, #include <stdio.h> saying "Add include path to settings"
C++
C
Visual Studio-Code
What is const void?
C++
C++11
C++14
How to remove "noise" from GCC/clang assembly output?
C++
Assembly
Gcc
Clang
Compiler Optimization
Any reason not to use global lambdas?
C++
Lambda
Using std::vector as view on to raw memory
C++
C++11
Vector
Stdvector
What is a niebloid?
C++
C++20
Why design a language with unique anonymous types?
C++
Types
Rust
Language Design
Why does the first element outside of a defined array default to zero?
C++
Arrays
Initialization
Undefined Behavior
Zero Initialization
How should I use FormatMessage() properly in C++?
C++
Windows
Error Handling
Formatmessage
How to add element to C++ array?
C++
Arrays
std::queue iteration
C++
Queue
Iteration
C++ Standard-Library
Convert an int to ASCII character
C++
C
Ascii
What are the barriers to understanding pointers and what can be done to overcome them?
C++
C
Pointers
How do I pass a unique_ptr argument to a constructor or a function?
C++
Arguments
C++11
Unique Ptr
How do I tokenize a string in C++?
C++
String
Split
Tokenize
Why no default move-assignment/move-constructor?
C++
C++11
Move Semantics
How to handle failure in constructor in C++?
C++
How to pass a vector to a function?
C++
Function
Vector
System where 1 byte != 8 bit?
C++
C
Byte
History
Computer Architecture
Does C++11 allow vector<const T>?
C++
Vector
C++11
Constants
Vector of structs initialization
C++
Vector
Struct
Push Back
What exactly is streambuf? How do I use it?
C++
Iostream
Equivalent of #region for C++
C#
C++
Overloading by return type
C++
Overloading
Should one use forward declarations instead of includes wherever possible?
C++
Forward Declaration
Passing std::string by Value or Reference
C++
String
Std
Move Semantics
'uint32_t' does not name a type
C++
Uint32 T
Cstdint
What is the difference between "::" "." and "->" in c++
C++
Operators
Field
Member
Does performance differ between Python or C++ coding of OpenCV?
C++
Python
Performance
Opencv
Initializing default values in a struct
C++
Error when using in-class initialization of non-static data member and nested class constructor
C++
C++11
Language Lawyer
How to use _CRT_SECURE_NO_WARNINGS
C++
Visual C++
Visual Studio-2012
Warnings
What are ALL_BUILD and ZERO_CHECK and do I need them?
C++
Visual Studio
Cmake
What does : mean?
C++
Syntax
<random> generates same number in Linux, but not in Windows
C++
Linux
Windows
Gcc
Visual Studio-2013
How can I improve performance via a high-level approach when implementing long equations in C++
C++
Performance
Optimization
Floating Point
G++
Which is more efficient: Return a value vs. Pass by reference?
C++
Performance
Function
Return Value
Pass by-Reference
Is ((a + (b & 255)) & 255) the same as ((a + b) & 255)?
C++
Binary
Logic
Are the experimental features of modern C++ reliable for long-term projects?
C++
C++11
Portability
C++17
C++ Standard-Library
When does type information flow backwards in C++?
C++
Types
Language Lawyer
C++17
Type Deduction
Using bitwise operators for Booleans in C++
C++
Boolean
Bitwise Operators
How to declare an array of strings in C++?
C++
Arrays
How to get file extension from string in C++
C++
String
Filenames
File Extension
What is a symbol table?
C++
C
Symbol Table
static variables in an inlined function
C++
Header
Linker
Inline Functions
What does the unary plus operator do?
C#
C++
C
Unary Operator
How to pass variable number of arguments to printf/sprintf
C++
C
Printf
Variadic Functions
Using Maven for C/C++ projects
C++
Maven 2
Maven Plugin
Defining global constant in C++
C++
How to define a string literal in gcc command line?
C++
C
Gcc
Command Line
Macros
volatile vs. mutable in C++
C++
Volatile
Mutable
Finding the position of the maximum element
C++
Algorithm
What is inside .lib file of Static library, Statically linked dynamic library and dynamically linked dynamic library?
C++
Dll
Linker
Static Libraries
Super high performance C/C++ hash map (table, dictionary)
C++
C
Dictionary
Hashtable
Hashmap
Why do C and C++ support memberwise assignment of arrays within structs, but not generally?
C++
C
Arrays
Variable Assignment
Struct
Narrowing conversions in C++0x. Is it just me, or does this sound like a breaking change?
C++
C++11
Survey
Aggregate Initialization
Why function template cannot be partially specialized?
C++
Language Design
Template Specialization
Partial Specialization
Function Templates
Why would I prefer using vector to deque
C++
Stl
Vector
Deque
Now that we have std::array what uses are left for C-style arrays?
C++
Arrays
C++11
Initialization
C# equivalent of C++ vector, with contiguous memory?
C#
C++
Vector
What is the difference between C++0x and C++11?
C++
C++11
What is array to pointer decay?
C++
C
Arrays
Pointers
Struct Constructor in C++?
C++
Struct
Constructor
module unsafe for SAFESEH image C++
C++
Visual Studio
Visual C++
Is 'auto const' and 'const auto' the same?
C++
C++11
Language Lawyer
Constants
Auto
Run C++ in command prompt - Windows
C++
Windows
Command Line
How can I portably call a C++ function that takes a char** on some platforms and a const char** on others?
C++
Constants
Portability
What's the use of memset() return value?
C++
C
Memset
Is calling destructor manually always a sign of bad design?
C++
Coding Style
Destructor
Why is this struct size 3 instead of 2?
C++
C
Struct
How std::unordered_map is implemented
C++
C++11
Hashmap
Unordered Map
if statement - short circuit evaluation vs readability
C++
If Statement
Short Circuiting
Side Effects
Why is GCC warning me about a fallthrough even when I use [[fallthrough]]?
C++
Switch Statement
C++17
Fall Through
Why does the most negative int value cause an error about ambiguous function overloads?
C++
Integer
Overloading
Negative Number
Ambiguous Call
Can I get Memcached running on a Windows (x64) 64bit environment?
C#
C++
Windows
64 Bit
Memcached
What is the easiest way to parse an INI File in C++?
C++
Winapi
Ini
Fileparse
CRTP to avoid dynamic polymorphism
C++
Templates
Virtual
Crtp
Base enum class inheritance
C++
Enums
Is there any reason to use C instead of C++ for embedded development?
C++
C
Embedded
C89
std::string comparison (check whether string begins with another string)
C++
String
Stl
Compare
Inverting a 4x4 matrix
C++
Algorithm
Math
Matrix
Matrix Inverse
pthread function from a class
C++
Pthreads
Easy check for unresolved symbols in shared libraries?
C++
Linker
Shared Libraries
What range of values can integer types store in C++
C++
Int
memset() or value initialization to zero out a struct?
C++
C
Visual C++
Struct
Initialization
Including #includes in header file vs source file
C++
File
Header
Include
Restrict C++ Template Parameter to Subclass
C++
Templates
How can I extract the file name and extension from a path in C++
C++
String
File Io
How to make C++ cout not use scientific notation
C++
Double
Cout
Ostream
Scientific Notation
How many bytes is unsigned long long?
C++
Need iterator when using ranged-based for loops
C++
C++11
For Loop
Iterator
What are the correct link options to use std::thread in GCC under linux?
C++
Multithreading
G++
C++11
Qt "private slots:" what is this?
C++
Qt
Signals Slots
How to use Libraries
C++
Windows
Macos
std::vector::resize() vs. std::vector::reserve()
C++
Stl
Vector
Forward declaration with unique_ptr?
C++
Destructor
Forward Declaration
Unique Ptr
What is monomorphisation with context to C++?
C++
Rust
What is this (( ))?
C++
C
How to call on a function found on another file?
C++
Sfml
Identifier
Set precision of std::to_string when converting floating point values
C++
String
C++11
Double
Floating
Proper way to create unique_ptr that holds an allocated array
C++
Linux
Gcc
C++11
Unique Ptr
Can branches with undefined behavior be assumed unreachable and optimized as dead code?
C++
Language Lawyer
Undefined Behavior
Dead Code
Unreachable Code
Is there still a use for inline?
C++
Function
Methods
Inline
Deprecated
Is the definition of "volatile" this volatile, or is GCC having some standard compliancy problems?
C++
C
Gcc
Standards
Why would the character 'A' be compared with 0x41?
C++
String
#include errors detected in vscode
C++
Visual Studio-Code
Is this floating-point optimization allowed?
C++
Floating Point
Clang
How can I "unuse" a namespace?
C++
Namespaces
C++builder
Detecting TCP Client Disconnect
C++
Sockets
Tcp
How can I pass a class member function as a callback?
C++
Callback
Function Pointers
C++03
Creating files in C++
C++
File Io
How is the C++ exception handling runtime implemented?
C++
Exception
Error Handling
Language Implementation
Boolean in ifdef: is "#ifdef A && B" the same as "#if defined(A) && defined(B)"?
C++
C Preprocessor
Conditional Compilation
C++ Object without new
C++
New Operator
Developing C wrapper API for Object-Oriented C++ code
C++
C
Wrapper
What happens if I assign a negative value to an unsigned variable?
C++
Type Conversion
Integer
Unsigned
Signed
How to read entire stream into a std::string?
C++
String
Stream
Experience using Boost.Log logging library?
C++
Boost
Logging
Boost Log
A warning - comparison between signed and unsigned integer expressions
C++
Unsigned Integer
Calling pthread_cond_signal without locking mutex
C++
Pthreads
Mutex
Signals
Condition Variable
Required and Optional Arguments Using Boost Library Program Options
C++
Boost
Boost Program-Options
Required
Optional
Why is there no base class in C++?
C++
Language Design
Why is CUDA pinned memory so fast?
C++
C
Linux
Cuda
trap representation
C++
C
Visual Studio-2010
Gcc
Language Lawyer
Unicode encoding for string literals in C++11
C++
Unicode
C++11
Utf
String Literals
Qt: resizing a QLabel containing a QPixmap while keeping its aspect ratio
C++
Qt
Qt4
Qlabel
C++ pass an array by reference
C++
Arrays
Pointers
Reference
Pass by-Reference
Is this a known pitfall of C++11 for loops?
C++
For Loop
C++11
Language Lawyer
Foreach
Is there go up line character? (Opposite of \n)
Python
C++
Terminal
Console
"Field has incomplete type" error
C++
What would 'std:;' do in c++?
C++
Std
Colon
Profiling the C++ compilation process
C++
Compilation
Profiling
C++ error 'Undefined reference to Class::Function()'
C++
Oop
Undefined
Outputting Date and Time in C++ using std::chrono
C++
Date
C++11
Time
Chrono
Can't use enum class as unordered_map key
C++
C++11
Map
Enums
Enum Class
Variadic template pack expansion
C++
Templates
C++11
Variadic Templates
What's the advantage of using std::allocator instead of new in C++?
C++
Heap Memory
Alloc
Difference between uint8_t, uint_fast8_t and uint_least8_t
C++
C
Integer
Avr
C99
Pass by value vs pass by rvalue reference
C++
C++11
C++14
Why does printf("%f",0); give undefined behavior?
C++
C
Printf
Implicit Conversion
Undefined Behavior
In C++, what is a virtual base class?
C++
Virtual Inheritance
What is the difference between using a Makefile and CMake to compile the code?
C++
C
Makefile
Cmake
Different behaviour of comma operator in C++ with return?
C++
Return
Language Lawyer
Operator Precedence
Comma Operator
If statement vs if-else statement, which is faster?
C++
Performance
C++11
Assembly
Microbenchmark
What exactly does GCC's -Wpsabi option do? What are the implications of supressing it?
C++
Linux
Gcc
Gcc Warning
Abi
How is std::is_function implemented?
C++
Templates
Std
Sfinae
Are C++ Reads and Writes of an int Atomic?
C++
Multithreading
Synchronization
Is TCHAR still relevant?
C++
C
Windows
Unicode
Wchar T
Accessing Environment Variables In C++
C++
Environment Variables
Selectively disable GCC warnings for only part of a translation unit
C++
C
Gcc
Compiler Warnings
Pragma
Pedantic gcc warning: type qualifiers on function return type
C++
Constants
Gcc Warning
Is there a production ready lock-free queue or hash implementation in C++
C++
Stl
Lock Free
Directory structure for a C++ library
C++
Directory Structure
Automake
long long in C/C++
C++
Types
Long Integer
C++ array initialization
C++
Syntax
How does this program work?
C++
C
Memory
Printf
Endianness
Using C++ filestreams (fstream), how can you determine the size of a file?
C++
Filesize
Fstream
Istream
What are the best (portable) cross-platform arbitrary-precision math libraries?
C++
C
Biginteger
Bigdecimal
Gmp
Fast rectangle to rectangle intersection
Javascript
C++
Language Agnostic
Graphics
What's the C++ version of Java's ArrayList
Java
C++
Arraylist
How to code a modulo (%) operator in C/C++/Obj-C that handles negative numbers
C++
C
C++11
Operator Overloading
Modulo
Convert std::string to QString
C++
String
Qt
Utf 8
Qstring
Get the last element of a std::string
C++
String
A Base Class pointer can point to a derived class object. Why is the vice-versa not true?
C++
Get Unix timestamp with C++
C++
Unix
Timestamp
Uint
__cdecl or __stdcall on Windows?
C++
Windows
Dll
Calling Convention
Binary Compatibility
What is use of c_str function?
C++
C
String
C Str
When to use shared_ptr and when to use raw pointers?
C++
Smart Pointers
Class template with template class friend, what's really going on here?
C++
Class
Templates
Inheritance: 'A' is an inaccessible base of 'B'
C++
Inheritance
How to find the index of current object in range-based for loop?
C++
Iterator
Current date and time as string
C++
String
Date
Datetime
Time
How is void *a = &a legal?
C++
What are Mixins (as a concept)
C++
Oop
Templates
Mixins
std::dynarray vs std::vector
C++
Stdvector
What does "Objective-C is a superset of C more strictly than C++" mean exactly?
C++
Objective C
C
Why is Math.pow(0, 0) === 1?
Javascript
C++
Language Agnostic
Pow
Does the C++ volatile keyword introduce a memory fence?
C++
Multithreading
C++11
Volatile
QtCreator: No valid kits found
C++
Qt
Ide
Qt Creator
Meaning of int (*) (int *) = 5 (or any integer value)
C++
Pointers
Function Pointers
Java 8 times faster with arrays than std::vector in C++. What did I do wrong?
Java
C++
Arrays
Performance
Stdvector
Is there any advantage of using std::addressof() function template instead of using operator& in C++?
C++
Understanding std::hardware_destructive_interference_size and std::hardware_constructive_interference_size
C++
Multithreading
Concurrency
C++17
Cpu Cache
Easiest way to convert int to string in C++
C++
String
Int
Type Conversion
Regular cast vs. static_cast vs. dynamic_cast
C++
Pointers
Casting
Image Processing: Algorithm Improvement for 'Coca-Cola Can' Recognition
C++
Algorithm
Image Processing
Opencv
Why should I use a pointer rather than the object itself?
C++
C++11
Pointers
C++ Faq
Differences between C++ string == and compare()?
C++
String
Resolve build errors due to circular dependency amongst classes
C++
Compiler Errors
Circular Dependency
C++ Faq
Is it a good idea to typedef pointers?
C++
C
Pointers
Typedef
Conventions
Semicolon after class declaration braces
C++
Class
Oop
Declaration
Is it good practice to make getters and setters inline?
C++
Performance
Inline
Getter Setter
How to instruct GCC to stop after 5 errors?
C++
Gcc
G++
Why do I need std::get_temporary_buffer?
C++
Memory Management
Stl
Buffer
Temporary
Include header files using command line option?
C++
Gcc
Include
Using char* as a key in std::map
C++
Map
Stdmap
How to add additional libraries to Visual Studio project?
C++
Visual C++
Shared Libraries
Libraries
C++ virtual function return type
C++
Inheritance
Virtual Functions
Overriding
Return Type
What is the point of STL Character Traits?
C++
String
Stl
Stdstring
Char Traits
How can I completely disable calls to assert()?
C++
C
Assert
How does photoshop blend two images together?
C++
C
Math
Image Processing
Photoshop
Initializing member variables using the same name for constructor arguments as for the member variables allowed by the C++ standard?
C++
How do I call the base class constructor?
C++
Constructor
Initializing const member within class declaration in C++
C++
G++
Difference between std::set and std::priority_queue
C++
Algorithm
Sorting
Priority Queue
What's "wrong" with C++ wchar_t and wstrings? What are some alternatives to wide characters?
C++
Winapi
Unicode
Internationalization
Wstring
Can I use Qt LGPL license and sell my application without any kind of restrictions?
C++
Qt
Licensing
Adding multiple executables in CMake
C++
Build
Cmake
Executable
G++ optimization beyond -O3/-Ofast
C++
G++
Compiler Optimization
Declare a reference and initialize later?
C++
Reference
Unused parameter in c++11
C++
C++11
Unused Variables
What is the fastest way to transpose a matrix in C++?
C++
Algorithm
Matrix
Transpose
How is it possible to declare nothing inside main() in C++ and yet have a working application after compilation?
C++
Object files vs Library files and why?
C++
Why does C++ allow us to surround the variable name in parentheses when declaring a variable?
C++
Most Vexing-Parse
Is there a legitimate use for void*?
C++
Why are references not "const" in C++?
C++
Reference
Constants
Language Lawyer
Decltype
Why can a const member function modify a static data member?
C++
Function
C++11
Static
Constants
Why would uint32_t be preferred rather than uint_fast32_t?
C++
C
Int
Manipulate system/visible clipping region in Windows 1809
C++
Windows
Winapi
Clipping
Why do C and C++ allow the expression (int) + 4*5?
C++
C
Casting
Language Lawyer
Max and min values in a C++ enum
C++
Enums
Returning unique_ptr from functions
C++
C++11
Unique Ptr
std::unique_lock<std::mutex> or std::lock_guard<std::mutex>?
C++
Multithreading
C++11
Mutual Exclusion
Stdmutex
How to convert vector to array
C++
Arrays
Vector
std::string to char*
C++
String
Char
When to use references vs. pointers
C++
Pointers
Reference
Printing all environment variables in C / C++
C++
C
What are the signs of crosses initialization?
C++
Initialization
Is auto_ptr deprecated?
C++
Standards
Smart Pointers
Auto Ptr
Unique Ptr
Why doesn't ADL find function templates?
C++
Argument Dependent-Lookup
Name Lookup
Template Function
Why are Python Programs often slower than the Equivalent Program Written in C or C++?
C++
Python
C
Performance
Programming Languages
Replacing ld with gold - any experience?
C++
C
Linker
Migration
Gold Linker
Ternary operator ?: vs if...else
C++
Performance
Conditional Operator
Where does the word "pragma" come from?
C++
C
Terminology
Pragma
When and how should I use exception handling?
C++
Windows
Exception
Exception Handling
Can I use C++11 with Xcode?
C++
Xcode
Gcc
C++11
Clang
Are parentheses around the result significant in a return statement?
C++
C
Semantics
How to format a QString?
C++
Qt
String Formatting
Two decimal places using printf( )
C++
C
Printf
Decimal
Link error "undefined reference to `__gxx_personality_v0'" and g++
C++
G++
How to compare two vectors for equality element by element in C++?
C++
Stdvector
How is "int* ptr = int()" value initialization not illegal?
C++
Visual C++
Pointers
Initialization
Built in-Types
Can a cast operator be explicit?
C++
Casting
Operator Keyword
Explicit
Allow for Range-Based For with enum classes?
C++
For Loop
C++11
Enums
Is it safe to return a struct in C or C++?
C++
C
Function
Struct
Return Type
What destructors are run when the constructor throws an exception?
C++
Constructor
Exception Handling
Destructor
Passing Arrays to Function in C++
C++
initialization of 'element' is skipped by 'case' label
C++
Debugging
When to use addressof(x) instead of &x?
C++
Addressof
Is signed integer overflow still undefined behavior in C++?
C++
C++11
Undefined Behavior
Integer Overflow
Confusion between C++ and OpenGL matrix order (row-major vs column-major)
C++
Math
Opengl
Matrix
Is 'float a = 3.0;' a correct statement?
C++
C++11
Is armadillo solve() thread safe?
C++
Multithreading
Openmp
Blas
Armadillo
At what point in the loop does integer overflow become undefined behavior?
C++
C
Undefined Behavior
Integer Overflow
Why can't GCC generate an optimal operator== for a struct of two int32s?
C++
Gcc
X86 64
Compiler Optimization
Micro Optimization
What's your favorite profiling tool (for C++)
C++
Performance
Profiling
Multiple classes in a header file vs. a single header file per class
C++
Performance
File Organization
How to detect code duplication during development?
C++
Code Duplication
What is the most efficient thread-safe C++ logger?
C++
Logging
Why are references not reseatable in C++
C++
Pointers
Reference
Language Design
char* vs std::string in c++
C++
Stl
Stdstring
Arrays
Is there ever a need for a "do {...} while ( )" loop?
C++
C
Loops
Why does const imply internal linkage in C++, when it doesn't in C?
C++
Is there any reason to use the 'auto' keyword in C++03?
C++
Keyword
C++03
What is *.o file?
C++
What is the difference between a static and const variable?
C++
C
Static
Constants
Remove comments from C/C++ code
C++
C
Comments
Is it a good practice to always use smart pointers?
C++
How I can print the wchar_t values to console?
C++
String
Wchar T
Unicode String
How to enable core dump in my Linux C++ program
C++
Linux
Crash Dumps
#pragma once vs include guards?
C++
Coding Style
How do I print the full value of a long string in gdb?
C++
C
String
Debugging
Gdb
Is C++ context-free or context-sensitive?
C++
Syntax
Grammar
Context Free-Grammar
Context Sensitive-Grammar
Calling a python method from C/C++, and extracting its return value
C++
Python
C
Python C-Api
Python Embedding
How do I create a pause/wait function using Qt?
C++
Qt
Sleep
Wait
Which is faster: x<<1 or x<<10?
C++
C
Performance
Cpu
Low Level
What's the advantage of multimap over map of vectors?
C++
Stl
Map
Multimap
Undefined behavior and sequence points reloaded
C++
Undefined Behavior
C++ Faq
Sequence Points
performance of unsigned vs signed integers
C++
C
Integer
Int
Unsigned
Object array initialization without default constructor
C++
Arrays
Constructor
What is the performance overhead of std::function?
C++
Boost
Std
What are the pointer-to-member operators ->* and .* in C++?
C++
Operators
Pointer to-Member
Operator Arrow-Star
How do I "break" out of an if statement?
C++
C++ chrono system time in milliseconds, time operations
C++
Time
C++11
Chrono
c++, std::atomic, what is std::memory_order and how to use them?
C++
Multithreading
Atomic
Memory Model
Stdatomic
C++11 make_pair with specified template parameters doesn't compile
C++
Templates
G++
C++11
Rvalue Reference
Should one never use static inline function?
C++
Static
Inline
Why is the C++ initializer_list behavior for std::vector and std::array different?
C++
Stl
C++11
Is x += a quicker than x = x + a?
C++
Performance
Operators
Definition of int64_t
C++
C
Integer
Long Integer
How to define different types for the same class in C++
C++
Types
A() = A() - why does it compile?
C++
ipch files on a Visual Studio project
C++
Visual Studio-2010
Has the new C++11 member initialization feature at declaration made initialization lists obsolete?
C++
C++11
Constructor
Initialization
Declaration
When and why do I need to use cin.ignore() in C++?
C++
Cin
Getline
Saturating subtract/add for unsigned bytes
C++
C
Optimization
Bit Manipulation
Saturation Arithmetic
Passing object by reference to std::thread in C++11
C++
Multithreading
C++11
Pass by-Reference
Stdthread
Big difference (x9) in the execution time between almost identical code in C and C++
C++
C
Performance
Gcc
Iostream
Why don't the official Qt examples and tutorials use smart pointers?
C++
Qt
C++11
Deprecated header <codecvt> replacement
C++
Utf 8
C++17
Utf 16
Codecvt
Is a pointer with the right address and type still always a valid pointer since C++17?
C++
Pointers
C++14
Language Lawyer
C++17
Inline version of a function returns different value than non-inline version
C++
Are stackless C++20 coroutines a problem?
C++
Asynchronous
C++20
C++ Coroutine
Is it legal for source code containing undefined behavior to crash the compiler?
C++
Language Lawyer
Undefined Behavior
Is `new` in `new int;` considered an operator?
C++
Language Lawyer
What is the purpose of having an empty pair base class?
C++
Libstdc++
What's the mathematical reason behind Python choosing to round integer division toward negative infinity?
Python
C++
Python 3.x
Rounding
Integer Division
Is there a LINQ library for C++?
C++
Linq
Unix
How do you convert CString and std::string std::wstring to each other?
C++
Mfc
C Strings
Stdstring
how boost::function and boost::bind work
C++
Boost
Boost Bind
Boost Function
What's the difference between the WIN32 and _WIN32 defines in C++
C++
C Preprocessor
How do I make my program watch for file modification in C++?
C++
File Io
Filesystems
Monitoring
Fsevents
What is the meaning and usage of __stdcall?
C++
Windows
Calling Convention
Function names in C++: Capitalize or not?
C++
Function
Coding Style
Naming Conventions
How to overload unary minus operator in C++?
C++
Operator Overloading
Are virtual destructors inherited?
C++
Inheritance
Virtual Destructor
LRU cache design
C++
Algorithm
Data Structures
Lru
Splitting C++ Strings Onto Multiple Lines (Code Syntax, Not Parsing)
C++
String
Syntax
Coding Style
Readability
Why use pointers?
C++
C
Pointers
What is std::promise?
C++
Multithreading
C++11
Promise
Standard Library
How do I create a simple Qt console application in C++?
C++
Qt
Console
What is the <iosfwd> header?
C++
Iostream
Forward Declaration
Iosfwd
Concatenating strings doesn't work as expected
C++
Operator Keyword
String Concatenation
Stdstring
Standard Library
Where are the man pages for C++?
C++
Linux
Documentation
Manpage
How do I deal with "signed/unsigned mismatch" warnings (C4018)?
C++
Comparison
Refactoring
Unsigned
Signed
Why does modulus division (%) only work with integers?
C++
C
How to disable warnings for particular include files?
C++
Suppress Warnings
Visual Studio: LINK : fatal error LNK1181: cannot open input file
C++
Visual Studio
Compiler Construction
trivial vs. standard layout vs. POD
C++
Typetraits
Merge multiple sets elements in a single set
C++
Stl
Set
Drawing Sphere in OpenGL without using gluSphere()?
C++
Opengl
Geometry
Why is Default constructor called in virtual inheritance?
C++
Inheritance
Virtual Inheritance
How to change the Title of the window in Qt?
C++
Qt
Window
Title
How to detect C++11 support of a compiler with CMake
C++
C++11
Cmake
Dividing two integers to produce a float result
C++
Precision
Integer Division
Enum vs Strongly typed enum
C++
C++11
Enums
Getting "source type is not polymorphic" when trying to use dynamic_cast
C++
C++11
c++ overloaded virtual function warning by clang?
C++
Warnings
Overloading
Virtual
Hidden
/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version CXXABI_1.3.8' not found
C++
Linux
Unix
What is the difference between an empty and a null std::shared_ptr in C++?
C++
C++11
Shared Ptr
Why does this invalid-looking code compile successfully on g++ 6.0?
C++
G++
Is it safe to rename argc and argv in main function?
C++
C
Main
Program behaving strangely on online IDEs
C++
Undefined Behavior
Integer Overflow
Why is the new random library better than std::rand()?
C++
C++11
Random
Do all C++ operators return something?
C++
Operators
In C++ can constructor and destructor be inline functions?
C++
Constructor
Destructor
How to set up Google C++ Testing Framework (gtest) with Visual Studio 2005
C++
Visual Studio
Unit Testing
Visual Studio-2005
Googletest
C++ style cast from unsigned char * to const char *
C++
Constants
Casting
How do I programmatically get the version of a DLL or EXE file?
C++
Winapi
Dll
Version
Exe
How to hide a string in binary code?
C++
Obfuscation
Use of min and max functions in C++
C++
C
Max
Min
Is it okay to inherit implementation from STL containers, rather than delegate?
C++
Stl
What are intrinsics?
C++
C
Intrinsics
Get home directory in Linux
C++
C
Linux
Public Data members vs Getters, Setters
C++
Setter
Getter
Example to use shared_ptr?
C++
Boost
Vector
Shared Ptr
Smart Pointers
Conventions for accessor methods (getters and setters) in C++
C++
Accessor
Setter
Getter
How can I get the class name from a C++ object?
C++
Class
Visual Studio 2010's strange "warning LNK4042"
C++
Visual Studio
Visual C++
Visual Studio-2010
Visual C++-2010
Moving from C++ to C
C++
C
What is the meaning of a const at end of a member function?
C++
Constants
Why are bitwise shifts (<< and >>) used for cout and cin?
C++
Io
Operators
Is C# really slower than say C++?
C#
C++
Performance
Undefined reference to static const int
C++
Gcc
When to Overload the Comma Operator?
C++
Function
Operator Overloading
Meaning of *& and **& in C++
C++
Pointers
Syntax
Reference
Symbols
C++ template typedef
C++
Templates
C++11
Typedef
How to get rid of `deprecated conversion from string constant to ‘char*’` warnings in GCC?
C++
String
Gcc
Difference between .a .o and .lo file
C++
C
Shared Libraries
Libraries
What requirements must std::map key classes meet to be valid keys?
C++
Stl
Map
Key
When I `throw` something, where is it stored in memory?
C++
Exception
Exception Handling
What should be the sizeof(int) on a 64-bit machine?
C++
C
Sizeof
Exclude source file in compilation using Makefile
C++
Makefile
Difference between uint32 and uint32_t
C++
C
Uint32
Uint32 T
c++11 regex slower than python
C++
Python
Regex
Performance
C++11
Can lambda functions be recursive?
C++
Recursion
C++11
Lambda
Fastest way to get a positive modulo in C/C++
C++
C
Performance
C++ for each, pulling from vector elements
C++
For Loop
Vector
Each
Why does std::array not have an constructor that takes a value for the array to be filled with?
C++
C++11
Stdarray
What is the rationale for parenthesis in C++11's raw string literals R"(...)"?
C++
C++11
Standards
String Literals
Is it ever OK to *not* use free() on allocated memory?
C++
C
Memory Management
Memory Leaks
Heap Memory
Usage of std::forward vs std::move
C++
C++11
Move
Forward
How do stackless coroutines differ from stackful coroutines?
C++
Concurrency
Coroutine
Boost Coroutine
Weird enum in destructor
C++
Enums
Why do lots of (old) programs use floor(0.5 + input) instead of round(input)?
C++
Rounding
Floor
Is it allowed for a compiler to optimize away a local volatile variable?
C++
Language Lawyer
C++17
Volatile
Is using an unsigned rather than signed int more likely to cause bugs? Why?
C++
C
Google Style-Guide
Will consteval functions allow template parameters dependent on function arguments?
C++
Language Lawyer
Constexpr
C++20
Class Template
Why doesn't 'd /= d' throw a division by zero exception when d == 0?
C++
Compiler Optimization
Undefined Behavior
Division
Divide by-Zero
What's the point of a PROTOTYPE macro that merely expands to its arguments?
C++
Macros
Is there an elegant and fast way to test for the 1-bits in an integer to be in a contiguous region?
C++
C
Bit Manipulation
C++ union in C#
C#
C++
Unions
c++ exception : throwing std::string
C++
Exception
Stl
Tool to visualise code flow (C/C++)
C++
C
Code Analysis
How should I order the members of a C++ class?
C++
Code Formatting
How can I use std::maps with user-defined types as key?
C++
Dictionary
Stl
Containers
Stdmap
What is the size of void?
C++
C
Language Lawyer
Sizeof
Which C++ Standard Library wrapper functions do you use?
C++
Global Variable within Multiple Files
C++
How can I merge two STL maps?
C++
Merge
Stl
Maps
Stdmap
shared_ptr and weak_ptr differences
C++
C++11
Shared Ptr
Weak Ptr
Cyclic Reference
How to check that an element is in a std::set?
C++
Stl
Set
Contains
Why aren't variable-length arrays part of the C++ standard?
C++
Arrays
Standards
Variable Length-Array
Variable Length
How to convert int to QString?
C++
Qt
Type Conversion
How to typedef a template class?
C++
Templates
C++11
Typedef
C++11 auto: what if it gets a constant reference?
C++
Reference
C++11
Auto
const char* and char const* - are they the same?
C++
Pointers
Constants
How to Add Linux Executable Files to .gitignore?
C++
C
Linux
Git
Gitignore
How to check whether file exists in Qt in c++
C++
Qt
File Exists
C++ vector's insert & push_back difference
C++
Why does adding inline assembly comments cause such radical change in GCC's generated code?
C++
Gcc
Assembly
Optimization
Inline Assembly
Unresolved external symbol "public: virtual struct QMetaObject const * __thiscall Parent
C++
Qt
Qobject
C++11 thread-safe queue
C++
Multithreading
C++11
Queue
Condition Variable
C++11 When clearing shared_ptr, should I use reset or set to nullptr?
C++
C++11
Shared Ptr
Reset
Nullptr
Multidimensional std::array
C++
Stl
Why should I use std::async?
C++
C++11
Asynchronous
Future
Stdasync
What is Security Development Lifecycle Checks option in Visual Studio?
C++
Visual Studio
Sdlc
How to use the priority queue STL for objects?
C++
Stl
Correct way of looping through C++ arrays
C++
Arrays
Loops
C++11
Capturing a reference by reference in a C++11 lambda
C++
C++11
Lambda
Language Lawyer
How to iterate through a list of objects in C++?
C++
For Loop
C++11
Stl
Iterator
What is the meaning of clang's -Wweak-vtables?
C++
Clang
Nodejs: What does `process.binding` mean?
Javascript
C++
node.js
V8
Undocumented Behavior
Is accessing data in the heap faster than from the stack?
C++
C
Performance
Heap Memory
Stack Memory
What is the name of this C++ functionality?
C++
Is it possible to declare constexpr class in a header and define it in a separate .cpp file?
C++
C++11
Constexpr
Why can't I define a function inside another function?
C++
Functor
Function Declaration
How to declare constexpr extern?
C++
Extern
Constexpr
How to properly link libraries with cmake?
C++
Opengl
Cmake
Undefined Reference
A 'for' loop that appears to be practically infinite
C++
Which C++ standard is the default when compiling with g++?
C++
G++
Mingw
How can this structure have sizeof == 0?
C++
Language Lawyer
Sizeof
Why isn't #pragma once automatically assumed?
C++
C
Pragma
How to make a for loop variable const with the exception of the increment statement?
C++
Algorithm
For Loop
Variables
Constants
How to implement big int in C++
C++
Biginteger
Bignum
Largenumber
How to Compile for OS X in Linux or Windows?
C++
C
Macos
Cross Compiling
How to get Current Directory?
C++
Windows
How to increment an iterator by 2?
C++
Visual C++
Stl
Iterator
How to write to the Output window in Visual Studio?
C++
Visual C++
C++ Cross-Platform High-Resolution Timer
C++
Cross Platform
Timer
How to use boost bind with a member function
C++
Boost
Boost Bind
Boost Function
Does the size of an int depend on the compiler and/or processor?
C++
C
Types
How to get available memory C++/g++?
C++
Memory Management
Cross Platform
efficient thread-safe singleton in C++
C++
Singleton
Thread Safety
Pthreads
Generic way to cast int to enum in C++
C++
Casting
Enums
How to use profile guided optimizations in g++?
C++
Optimization
G++
Are inner classes in C++ automatically friends?
C++
Friend
Nested Class
Sorting std::map using value
C++
Dictionary
Std
How to print a string in C++
C++
String
Printf
Why can't I make a vector of references?
C++
Vector
Reference
Stl
Container Data-Type
Compiling C++11 with g++
C++
C++11
G++
Flags
Why does the C++ STL not provide any "tree" containers?
C++
Data Structures
Tree
Stl
Is there any case where a return of a RValue Reference (&&) is useful?
C++
C++11
Move Semantics
Rvalue Reference
QVector vs QList
C++
Qt
List
Vector
ULL suffix on a numeric literal
C++
C
Accessing certain pixel RGB value in openCV
C++
Opencv
Why would code actively try to prevent tail-call optimization?
C++
C
Optimization
Compiler Optimization
Tail Call-Optimization
Why should I initialize member variables in the order they're declared in?
C++
G++
Compiler Warnings
Defining a variable in the condition part of an if-statement?
C++
Variables
If Statement
Standards
C++11: why does std::condition_variable use std::unique_lock?
C++
Multithreading
C++11
Mutex
Does the range-based 'for' loop deprecate many simple algorithms?
C++
Algorithm
Stl
C++11
Foreach
How do I pass multiple ints into a vector at once?
C++
C++11
Vector
Push Back
'cout' was not declared in this scope
C++
Iostream
Cout
What is difference between const and non const key?
C++
Key
Language Lawyer
Key Value
Stdmap
why is `std::initializer_list` often passed by value?
C++
C++11
Is Bjarne wrong about this example of ADL, or do I have a compiler bug?
C++
C++11
Argument Dependent-Lookup
Is the default Move constructor defined as noexcept?
C++
C++11
Constructor
Move Semantics
Most optimized way of concatenation in strings
C++
String
Concatenation
What is the difference between dynamic dispatch and late binding in C++?
C++
Oop
C++ Return value, reference, const reference
C++
Reference
Const Reference
Return by-Reference
Return by-Value
Is there a reason why not to use link-time optimization (LTO)?
C++
C
Performance
Compilation
Compiler Optimization
Error: invalid operands of types ‘const char [35]’ and ‘const char [2]’ to binary ‘operator+’
C++
String
C Preprocessor
Stdstring
Is unique_ptr guaranteed to store nullptr after move?
C++
C++11
Move Semantics
Unique Ptr
LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in file.obj
C++
Matlab
Visual C++
Cuda
Error: variable "cannot be implicitly captured because no default capture mode has been specified"
C++
C++11
Lambda
Enum constants behaving differently in C and C++
C++
C
Incrementing 'masked' bitsets
C++
C
Bit Manipulation
Intrinsics
Declaring a variable with two types: "int char"
C++
Type Conversion
Initialization
Uniform Initialization
Narrowing
I do not understand why this compiles
C++
Syntax
Declaration
Most Vexing-Parse
Template Constraints C++
C++
Templates
Constraints
initialize a const array in a class initializer in C++
C++
Initialization
C++03
Array Initialize
multiset, map and hash map complexity
C++
Complexity Theory
Big O
Calling delete on variable allocated on the stack
C++
Stack
Heap Memory
Delete Operator
How do I use a third-party DLL file in Visual Studio C++?
C++
Visual Studio
Winapi
Dll
Why can't you overload the '.' operator in C++?
C++
Operator Overloading
how do I print an unsigned char as hex in c++ using ostream?
C++
Formatting
Cout
Ostream
Unsigned Char
What is the difference between a .cpp file and a .h file?
C++
Header
Include
What's the difference between a header file and a library?
C++
C
Take the address of a one-past-the-end array element via subscript: legal by the C++ Standard or not?
C++
C
Standards
Language Lawyer
What is a good easy to use profiler for C++ on Linux?
C++
Linux
Profiler
How to get the MD5 hash of a file in C++?
C++
Hash
Md5
Why should exceptions be used conservatively?
C++
Exception
Extending enums in C++?
C++
Enums
Convert float to std::string in C++
C++
Type Conversion
In C++, is it possible to forward declare a class as inheriting from another class?
C++
Inheritance
Forward Declaration
Calling a constructor to re-initialize object
C++
Constructor
Define a struct inside a class in C++
C++
Class
Struct
Easy way to parse a url in C++ cross platform?
C++
Url
Uri
How to convert a command-line argument to int?
C++
Argument Passing
Command Line-Arguments
Can boolean operators be used with the preprocessor?
C++
C Preprocessor
pinvokestackimbalance -- how can I fix this or turn it off?
C#
C++
Visual Studio-2010
Visual Studio
Pinvoke
How to check if a std::string is set or not?
C++
Getting first value from map in C++
C++
Map
Class variables: public access read-only, but private access read/write
C++
Access Modifiers
c++ inline function?
C++
Inline
What's this C++ syntax that puts a brace-surrounded block where an expression is expected?
C++
Syntax
Language Extension
Gcc Extensions
Gcc Statement-Expression
Which is better option to use for dividing an integer number by 2?
C++
C
Optimization
Division
Micro Optimization
How do I print a double value with full precision using cout?
C++
Floating Point
Precision
Iostream
Cout
The usage of anonymous enums
C++
Enums
Get current working directory in a Qt application
C++
Qt
How to create a vector of user defined size but with no predefined values?
C++
Vector
Static function declared but not defined in C++
C++
Static Methods
Why does this call the default constructor?
C++
Syntax
Most Vexing-Parse
Does 'auto' type assignments of a pointer in c++11 require '*'?
C++
Pointers
C++11
Auto
C++11 std::set lambda comparison function
C++
Stl
C++11
Lambda
Std Function
cout << with char* argument prints string, not pointer value
C++
Project ERROR: Unknown module(s) in QT: webkitwidgets
C++
Qt
Qt5
Qtwebkit
C++ Abstract Class: constructor yes or no?
C++
Class
Constructor
Abstract
What is the role of glBindVertexArrays vs glBindBuffer and what is their relationship?
C++
Opengl
Different cast operator called by different compilers
C++
Language Lawyer
What does P::************ mean in Boost assert.hpp file?
C++
Pointers
Boost
How to configure CLion IDE for Qt Framework?
C++
Qt
Clion
What is the difference between std::transform and std::for_each?
C++
C++11
Stl Algorithm
Preparation for std::iterator Being Deprecated
C++
Iterator
Standards
Deprecated
C++17
Using 'auto' type deduction - how to find out what type the compiler deduced?
C++
C++11
Auto
Chrono
fatal error: filesystem: No such file or directory
C++
C++17
Where is the lock for a std::atomic?
C++
C++11
X86
Atomic
Stdatomic
Why do I need to explicitly write the 'auto' keyword?
C++
C++11
Auto
Initializing variables in an "if" statement
C++
C++17
Can the C preprocessor be used to tell if a file exists?
C++
Include
C Preprocessor
UTF8 to/from wide char conversion in STL
C++
Unicode
Stl
Utf 8
Character Encoding
how-to initialize 'const std::vector<T>' like a c array
C++
Stl
Examples of good gotos in C or C++
C++
C
Goto
C++: difference between ampersand "&" and asterisk "*" in function/method declaration?
C++
Pointers
Reference
Most useful shortcut in Eclipse CDT
C++
Eclipse
Keyboard Shortcuts
Eclipse Cdt
Why was std::strstream deprecated?
C++
Stringstream
Strstream
const int = int const?
C++
Nested templates with dependent scope
C++
Templates
Scope
Nested
What is a non-trivial constructor in C++?
C++
Constructor
Is using #pragma warning push/pop the right way to temporarily alter warning level?
C++
Visual C++
Warnings
Compiler Warnings
Pragma
Correct way to work with vector of arrays
C++
Arrays
Vector
Stdvector
overloading friend operator<< for template class
C++
Templates
Operator Overloading
Friend
Ostream
Performance of qsort vs std::sort?
C++
Performance
Sorting
Stl
What does "class :" mean in C++?
C++
Class
Colon
How exactly does __attribute__((constructor)) work?
C++
Objective C
C
Gcc
Fastest way to determine if an integer is between two integers (inclusive) with known sets of values
C++
C
Performance
Math
Passing a 2D array to a C++ function
C++
Arrays
Pointers
Multidimensional Array
c++ array assignment of multiple values
C++
Arrays
Programming Languages
Syntax
more spirit madness - parser-types (rules vs int_parser<>) and meta-programming techniques
C++
Boost
Boost Spirit
Template Meta-Programming
C++: is return value a L-value?
C++
Return Value
Lvalue
How does one downcast a std::shared_ptr?
C++
C++11
Shared Ptr
Downcast
Why are NULL pointers defined differently in C and C++?
C++
C
Pointers
Null
Two phase lookup - explanation needed
C++
Templates
The actor model: Why is Erlang/OTP special? Could you use another language?
C++
Concurrency
Erlang
Actor
Message Passing
Is the behavior of subtracting two NULL pointers defined?
C++
C
C99
C89
Correct way to inherit from std::exception
C++
Exception
C++11 "auto" semantics
C++
C++11
Vector: initialization or reserve?
C++
Vector
C++11: How to alias a function?
C++
Linux
Gcc
C++11
How do you find what version of libstdc++ library is installed on your linux machine?
C++
Linux
Shared Libraries
C++ Filehandling: Difference between ios::app and ios::ate?
C++
File
Fstream
C++ Standard-Library
C and C++ : Partial initialization of automatic structure
C++
C
Should I return const objects?
C++
Copying std::vector: prefer assignment or std::copy?
C++
Stl
Copy
C++ - include unistd.h: why not cunistd?
C++
C
1D or 2D array, what's faster?
C++
C
Arrays
Is the pass-by-value-and-then-move construct a bad idiom?
C++
C++11
Move Semantics
Pass by-Value
Rvalue Reference
What is a nondeduced context?
C++
Templates
Template Argument-Deduction
How to emulate EBO when using raw storage?
C++
C++14
If a 32-bit integer overflows, can we use a 40-bit structure instead of a 64-bit long one?
C++
C
Memory Management
Integer Overflow
"template<>" vs "template" without brackets - what's the difference?
C++
Templates
Template Specialization
Converting std::__cxx11::string to std::string
C++
String
C++11
Types
Std
Idiom for iterating "between each consecutive pair of elements"
C++
C++11
Idioms
Separator
Why is the ternary operator used to define 1 and 0 in a macro?
C++
C
Boolean
Ternary Operator
Duplicate code using c++11
C++
C++11
Templates
In CLion, header only library: file "does not belong to any project target, code insight features might not work properly"
C++
Cmake
Clion
Header Only
Can I use NULL as substitution for the value of 0?
C++
C
Pointers
Null
Language Lawyer
Subtracting packed 8-bit integers in an 64-bit integer by 1 in parallel, SWAR without hardware SIMD
C++
C
Bit Manipulation
Simd
Swar
Why is Python recursion so expensive and what can we do about it?
Python
C++
Recursion
Stack Overflow
Getting a FILE* from a std::fstream
C++
C
File
File Io
Fstream
Best C/C++ Network Library
C++
C
Networking
How can I use covariant return types with smart pointers?
C++
Covariance
Smart Pointers
Export all symbols when creating a DLL
C++
Windows
Visual Studio
Visual Studio-2005
Get elapsed time in Qt
C++
Qt
Why is Visual C++ lacking refactor functionality?
C++
Visual Studio
Visual Studio-2008
Visual C++
Lazy evaluation in C++
C++
Lazy Evaluation
vector or map, which one to use?
C++
Performance
Stl
Why would you use 'extern "C++"'?
C++
C
Array size at run time without dynamic allocation is allowed?
C++
C
Array Initialization
How do you introduce unit testing into a large, legacy (C/C++) codebase?
C++
C
Unit Testing
Unix
Legacy
Declaring an object before initializing it in c++
C++
Scope
Declaration
Instantiation
Circular lock-free buffer
C++
Algorithm
Multithreading
Concurrency
Lock Free
How to initialize a const field in constructor?
C++
Constructor
Constants
Ctor Initializer
error C2065: 'cout' : undeclared identifier
C++
Namespaces
Visual Studio-2010
Std
Why should I use the "using" keyword to access my base class method?
C++
Oop
Inheritance
Using
What's a good directory structure for larger C++ projects using Makefile?
C++
Makefile
Output unicode strings in Windows console app
C++
Unicode
Iostream
Windows Console
error LNK2005: xxx already defined in MSVCRT.lib(MSVCR100.dll) C:\something\LIBCMT.lib(setlocal.obj)
C++
C
Visual C++
Linker
msvcr100.dll
How to sort an STL vector?
C++
Sorting
Stl
What is the lifetime of a static variable in a C++ function?
C++
Static
Lifetime
Do I need to explicitly call the base virtual destructor?
C++
Destructor
What is external linkage and internal linkage?
C++
C++ Faq
Checking if a double (or float) is NaN in C++
C++
Double
Nan
Why must the copy assignment operator return a reference/const reference?
C++
Operator Overloading
Copy Constructor
Assignment Operator
What is the difference between WM_QUIT, WM_CLOSE, and WM_DESTROY in a windows program?
C++
Windows
Messages
Foreach loop in C++ equivalent of C#
C#
C++
C++ inline member function in .cpp file
C++
Function
Inline
Member
GNU autotools: Debug/Release targets?
C++
Autotools
Autoconf
Automake
buildbot vs hudson/jenkins for C++ continuous integration
C++
Continuous Integration
Hudson
Jenkins
Buildbot
Does const-correctness give the compiler more room for optimization?
C++
C
Pointers
Constants
Const Correctness
Obtaining list of keys and values from unordered_map
C++
Vector
C++11
Std
Unordered Map
What is the difference between std::set and std::vector?
C++
Stl
What does the "lock" instruction mean in x86 assembly?
C++
Qt
Assembly
X86
Create a directory if it doesn't exist
C++
Windows
File
Directory
Copy
How to project a point onto a plane in 3D?
C++
C
error LNK2005, already defined?
C++
Append an int to a std::string
C++
Std
How do I deal with the max macro in windows.h colliding with max in std?
C++
Iostream
Cin
How to print Unicode character in C++?
C++
Unicode
Iostream
Cout
Wchar T
Why is the != operator not allowed with OpenMP?
C++
C
Multithreading
Parallel Processing
Openmp
C++11: Correct std::array initialization?
C++
Arrays
C++11
Initialization
C++14
Moving elements from std::vector to another one
C++
Vector
C++ printing boolean, what is displayed?
C++
Boolean
Cout
Should I assign or reset a unique_ptr?
C++
C++11
Smart Pointers
Unique Ptr
Is there a 128 bit integer in C++?
C++
Performance
Types
Cross Platform
Uuid
Is there a more efficient implementation for a bidirectional map?
C++
C++11
Data Structures
Map
Bimap
When to use bit-fields in C?
C++
C
Memory
Struct
Types
Unusual usage of .h file in C
C++
C
Detect gcc as opposed to msvc / clang with macro
C++
Gcc
Member function with static linkage
C++
Static
Why does std::transform and similar cast the 'for' loop increment to (void)?
C++
Why is a const variable sometimes not required to be captured in a lambda?
C++
Lambda
Constants
Language Lawyer
rc.exe no longer found in VS 2015 Command Prompt
C++
Windows
Cmake
Windows 10
Visual Studio-2017
Cv-qualifications of prvalues (revisited)
C++
Language Lawyer
C++17
Temporary Objects
Prvalue
Why does my Intel Skylake / Kaby Lake CPU incur a mysterious factor 3 slowdown in a simple hash table implementation?
C++
Performance
Gcc
X86 64
Hashtable
Getting a boost::shared_ptr for this
C++
Boost
How do you properly use WideCharToMultiByte
C++
Unicode
Character Encoding
Codepages
c++ STL set difference
C++
Stl
Set
Stdset
Set Difference
Can I access private members from outside the class without using friends?
C++
Encapsulation
Private Members
Why are there digraphs in C and C++?
C++
C
C99
Digraphs
When should I use typedef in C++?
C++
Typedef
#include all .cpp files into a single compilation unit?
C++
Visual Studio
Build
How do I build an import library (.lib) AND a DLL in Visual C++?
C++
Visual Studio
Dll
Import
C++ namespaces advice
C++
Namespaces
Generate SHA hash in C++ using OpenSSL library
C++
Cryptography
How to detect whether there is a specific member variable in class?
C++
Visual Studio
Templates
G++
Sfinae
Will an 'empty' constructor or destructor do the same thing as the generated one?
C++
Class
Oop
Constructor
Destructor
Derived template-class access to base-class member-data
C++
Templates
Inheritance
Scope
Name Lookup
When to use virtual destructors?
C++
Polymorphism
Shared Ptr
Virtual Destructor
Is < faster than <=?
C++
C
Performance
Assembly
Relational Operators
What is an undefined reference/unresolved external symbol error and how do I fix it?
C++
Linker Errors
Undefined Reference
C++ Faq
Unresolved External
What is a lambda expression in C++11?
C++
Lambda
C++11
C++ Faq
What is the difference between const int*, const int * const, and int const *?
C++
C
Pointers
Constants
C++ Faq
Why does changing 0.1f to 0 slow down performance by 10x?
C++
Performance
Visual Studio-2010
Compilation
Floating Point
What is this weird colon-member (" : ") syntax in the constructor?
C++
Syntax
Constructor
C++ Faq
Ctor Initializer
Why can't I inherit from int in C++?
C++
Inheritance
Integer
Language Design
Strong Typing
C++ std::set update is tedious: I can't change an element in place
C++
Stl
Set
C++ and,or,not,xor keywords
C++
Operators
Is sizeof in C++ evaluated at compilation time or run time?
C++
Runtime
Sizeof
Compile Time
How does dereferencing of a function pointer happen?
C++
C
Pointers
Function Pointers
Case insensitive std::string.find()
C++
String
Stl
Case Insensitive
Wstring
Initialize a vector array of strings
C++
Stl
How to convert typename T to string in c++
C++
Templates
Vector erase iterator
C++
Vector
Iterator
Cygwin Make bash command not found
C++
Makefile
Cygwin
Command
What does stream mean? What are its characteristics?
C#
C++
Class
Stream
Terminology
Why am I getting string does not name a type Error?
C++
String
Std
Why use #define instead of a variable
C++
C Preprocessor
Object destruction in C++
C++
Exception
Destructor
C++ Faq
Object Lifetime
What does the [[carries_dependency]] attribute mean?
C++
Multithreading
Memory Model
Stdatomic
Carries Dependency
Creating a simple configuration file and parser in C++
C++
File
Parsing
Configuration
Settings
When is an integer<->pointer cast actually correct?
C++
C
Pointers
Casting
c++: Format number with commas?
C++
Comma
Number Formatting
What's the Use of '\r' escape sequence?
C++
C
Escaping
Carriage Return
What are the advantages of boost::noncopyable
C++
Boost
Noncopyable
std::lexical_cast - is there such a thing?
C++
Parsing
Casting
Std
C++ Standard-Library
Prepend std::string
C++
String
Prepend
Does there exist a static_warning?
C++
Static
Compiler Warnings
How to get a pointer from a reference?
C++
Can we reassign the reference in C++?
C++
Reference
rand() between 0 and 1
C++
Random
Initializing fields in constructor - initializer list vs constructor body
C++
Parameters
What do each memory_order mean?
C++
C++11
Thread Safety
Atomic
Memory Model
How to make generic computations over heterogeneous argument packs of a variadic template function?
C++
C++11
Iteration
Variadic Templates
Template Meta-Programming
What would be a "Hello, World!" example for "std::ref"?
C++
C++11
Std
Ref
How to forward declare a class which is in a namespace
C++
Namespaces
"relocation R_X86_64_32S against " linking Error
C++
Linux
Shared Libraries
Static Libraries
What's the C++ suffix for long double literals?
C++
C
Literals
Floating Point-Precision
What does this typedef statement mean?
C++
Typedef
Why must a short be converted to an int before arithmetic operations in C and C++?
C++
C
Int
Short
Integer Promotion
When to use std::async vs std::threads?
C++
Multithreading
C++11
Stdasync
C++ view types: pass by const& or by value?
C++
C++11
Parameter Passing
Pass by-Reference
Pass by-Value
const& , & and && specifiers for member functions in C++
C++
C++11
Constants
> vs. >= in bubble sort causes significant performance difference
Java
C++
Performance
Optimization
non-trivial designated initializers not supported
C++
Initialization
RAII vs. Garbage Collector
C++
Memory Leaks
Garbage Collection
Smart Pointers
Does using heap memory (malloc/new) create a non-deterministic program?
C++
C
Real Time
Deterministic
Non Deterministic
C++17: Keep only some members when tuple unpacking
C++
Tuples
C++17
Pretty-print C++ STL containers
C++
Templates
C++11
Operator Overloading
Pretty Print
const vs constexpr on variables
C++
Variables
C++11
Constants
Constexpr
Disabling Warnings generated via _CRT_SECURE_NO_DEPRECATE
C++
Visual Studio
Visual C++
What parameter parser libraries are there for C++?
C++
Command Line-Arguments
c++ integer->std::string conversion. Simple function?
C++
Integer
Stdstring
Is there any 'out-of-the-box' 2D/3D plotting library for C++?
C++
Graph
Wxwidgets
Plot
using a class defined in a c++ dll in c# code
C#
C++
Dll
Pinvoke
Useful Add-Ins or Plug-Ins for native Visual Studio developer
C++
Visual Studio
Visual C++
Visual Studio-Addins
Print leading zeros with C++ output operator?
C++
Formatting
Numbers
class & function names highlighting in Vim
C++
Vim
Syntax Highlighting
Textmate
Vim Syntax-Highlighting
How do I decide whether to use ATL, MFC, Win32 or CLR for a new C++ project?
C++
Winapi
Mfc
Clr
Atl
C++ static initialization order
C++
Static Variables
Static Order-Fiasco
Initialization Order
Why use !! when converting int to bool?
C++
Integer
Boolean
error: cast from 'void*' to 'int' loses precision
C++
Casting
Void Pointers
Embedded C++ : to use STL or not?
C++
Stl
Embedded
Struct with template variables in C++
C++
Class
Templates
Struct
How to use an iterator?
C++
Pointers
Vector
Iterator
Using Statement
inline vs __inline vs __inline__ vs __forceinline?
C++
Inline
Keyword
long double vs double
C++
Floating Point
Long Double
Overriding a default option(...) value in CMake from a parent CMakeLists.txt
C++
Build
Build Process
Cmake
do I need to close a std::fstream?
C++
Std
Fstream
Ofstream
sorting a vector of structs
C++
Sorting
Vector
What is the value of an undefined constant used in #if?
C++
C Preprocessor
What is SOCK_DGRAM and SOCK_STREAM?
C++
Sockets
Protocols
Tcp
Use of "this" keyword in C++
C++
This
Cannot open output file, permission denied
C++
Compiler Errors
Codeblocks
Permission Denied
How to initialize and print a std::wstring?
C++
C++ Cli
Wstring
How bad is "if (!this)" in a C++ member function?
C++
Visual C++
Gcc
static variable link error
C++
Xcode
Static Libraries
Clang
Static Methods
Generating combinations in c++
C++
Algorithm
Combinations
How to declare a global variable in C++
C++
Visual Studio
"items list" or "item list"
C++
Naming Conventions
How can I get a value from a map?
C++
Dictionary
Stdmap
Why aren't my include guards preventing recursive inclusion and multiple symbol definitions?
C++
Header Files
C++ Faq
Include Guards
Type of `this` in static member function?
C++
C++11
Language Lawyer
Why use std::bind over lambdas in C++14?
C++
Lambda
Bind
C++14
Is begin() == end() for any empty() vector?
C++
Stdvector
Comparing floating point number to zero
C++
Floating Point
Endless loop in C/C++
C++
C
Loops
Infinite Loop
Why does unique_ptr take two template parameters when shared_ptr only takes one?
C++
C++11
Std
Shared Ptr
Unique Ptr
Why is this C++ program so incredibly fast?
C++
Performance
Assembly
Compiler Construction
numpy-like package for node
Javascript
C++
node.js
Numpy
Multidimensional Array
What is the usefulness of `enable_shared_from_this`?
C++
Boost
Boost Asio
Tr1
Where do I find the current C or C++ standard documents?
C++
C
Standards
C++ Faq
Callback functions in C++
C++
Callback
Function Pointers
Is there a performance difference between i++ and ++i in C++?
C++
Performance
Oop
Post Increment
Pre Increment
Virtual/pure virtual explained
C++
Virtual
Is masking before unsigned left shift in C/C++ too paranoid?
C++
C
Language Lawyer
Undefined Behavior
Integer Arithmetic
How to ensure that every method of a class calls some other method first?
C++
C++11
Is a whole number float divided by itself guaranteed to be 1.f?
C++
Floating Point
Argument order to std::min changes compiler output for floating-point
Android
C++
Assembly
X86
Floating Point
What C++ pitfalls should I avoid?
C++
Stl
Can I use identical names for fields and constructor parameters?
C++
Parameters
Constructor
Why not use pointers for everything in C++?
C++
Pointers
Heap Memory
Stack Memory
Tools to find included headers which are unused?
C++
Coding Style
Header Files
Should I use printf in my C++ code?
C++
Formatting
Why doesn't this reinterpret_cast compile?
C++
Casting
Reinterpret Cast
C++: Life span of temporary arguments?
C++
Destructor
How to speed up g++ compile time (when using a lot of templates)
C++
Templates
G++
Compilation
Is using double faster than float?
C++
Performance
X86
Intel
Osx Snow-Leopard
C++: Can a struct inherit from a class?
C++
Class
Inheritance
Struct
How to get the GL library/headers?
C++
Opengl
Post-increment and Pre-increment concept?
C++
Conceptual
Post Increment
Pre Increment
How to iterate over a priority_queue?
C++
Stl
Queue
Is it possible to "store" a template parameter pack without expanding it?
C++
Templates
C++11
Variadic Templates
Default inheritance access specifier
C++
Inheritance
Why do I get an error trying to call a template member function with an explicit type parameter?
C++
Templates
Metaprogramming
What is the difference between the /Ox and /O2 compiler options?
C++
Visual Studio
Visual C++
Compiler Optimization
Compiler Options
Performance of built-in types : char vs short vs int vs. float vs. double
C++
C
Performance
Built In
What is a static constructor?
C++
C++ static polymorphism (CRTP) and using typedefs from derived classes
C++
Templates
Inheritance
Typedef
Crtp
Are unused includes harmful in C/C++?
C++
What is the lifetime of a C++ lambda expression?
C++
Lambda
C++11
How to copy std::string into std::vector<char>?
C++
String
Vector
Copy
Remove elements of a vector inside the loop
C++
Vector
Erase
Should I copy an std::function or can I always take a reference to it?
C++
Lambda
Std Function
Why doesn't emplace_back() use uniform initialization?
C++
Vector
C++11
Uniform Initialization
Difference between std::function<> and a standard function pointer?
C++
C++11
Using std::max_element on a vector<double>
C++
Vector
Max
Min
int operators != and == when comparing to zero
C++
Performance
Assembly
Machine Code
WINMAIN and main() in C++ (Extended)
C++
Windows
Main
Winmain
How to compile C++ with C++11 support in Mac Terminal
C++
Macos
C++11
Terminal
G++
DEBUG macros in C++
C++
C
Debugging
C Preprocessor
Enable C++11 support on Android
Android
C++
C++11
How do you print a C++11 time_point?
C++
Templates
Time
C++11
Chrono
'vector' in namespace 'std' does not name a type
C++
Std
Stdvector
Fast textfile reading in c++
C++
Performance
Io
Ifstream
How to use bitmask?
C++
C++11
Bitmask
How to use range-based for() loop with std::map?
C++
C++11
For Loop
Dictionary
How to detect a Christmas Tree?
C++
Python
Opencv
Image Processing
Computer Vision
Simple example of threading in C++
C++
Multithreading
fixed length data types in C/C++
C++
C
A lambda's return type can be deduced by the return value, so why can't a function's?
C++
Function
C++11
Lambda
Auto
enum vs constexpr for actual static constants inside classes
C++
C++11
Constexpr
rationale for std::lower_bound and std::upper_bound?
C++
Stl
Lower Bound
Upperbound
Loop with a zero execution time
C++
C
Optimization
Execution Time
As If
Why would the behavior of std::memcpy be undefined for objects that are not TriviallyCopyable?
C++
C++11
Language Lawyer
Memcpy
Object Lifetime
What does the compiler do here: int a = b * (c * d * + e)?
C++
Arithmetic Expressions
Why can't run-time polymorphism be solved at compile time?
C++
Polymorphism
What's the difference between static constexpr and static inline variables in C++17?
C++
C++17
Constexpr
What does the g stand for in gcount, tellg and seekg?
C++
Iostream
Why is C++ template use not recommended in a space/radiated environment?
C++
Templates
Embedded
Fault Tolerance
`std::variant` vs. inheritance vs. other ways (performance)
C++
Performance
Inheritance
C++17
Std Variant
why does long long 2147483647 + 1 = -2147483648?
C++
C
Undefined Behavior
Integer Overflow
Twos Complement
Best C++ IDE or Editor for Windows
C++
Windows
Ide
Editor
How do you implement Coroutines in C++
C++
Coroutine
C++17
Returning a const reference to an object instead of a copy
C++
Constants
Is there a portable equivalent to DebugBreak()/__debugbreak?
C++
Portability
Debugbreak
Recommended way to initialize srand?
C++
Random
Srand
Why can't I have a non-integral static const member in a class?
C++
virtual assignment operator C++
C++
Operator Overloading
Virtual
Virtual Functions
Should C++ eliminate header files?
C++
Header Files
What's the correct way to use printf to print a size_t?
C++
C
What happens if you increment an iterator that is equal to the end iterator of an STL container
C++
Stl
Vector
Iterator
Integrate Python And C++
C++
Python
Integration
Global memory management in C++ in stack or heap?
C++
Memory Management
Stack
How to avoid memory leaks when using a vector of pointers to dynamically allocated objects in C++?
C++
Stl
Pointers
Vector
Derived
Conversion constructor vs. conversion operator: precedence
C++
Constructor
Operators
Type Conversion
Conversion Operator
C-Style Strings as template arguments?
C++
Templates
String
What does '&' do in a C++ declaration?
C++
Syntax
Operators
How do I make this C++ object non-copyable?
C++
Copy Constructor
Noncopyable
Where would you use a friend function vs. a static member function?
C++
Friend Function
Static Functions
Permutation of array
Java
C++
Algorithm
Configuring the GCC compiler switches in Qt, QtCreator, and QMake
C++
Qt
C++11
Qt Creator
Is there any "standard" htonl-like function for 64 bits integers in C++?
C++
64 Bit
Portability
Endianness
Htonl
Accessing protected members in a derived class
C++
What is an iterator's default value?
C++
Stl
Default
Containers
Iterator
Converting ostream into standard string
C++
Stl
Iostream
Should mutexes be mutable?
C++
Mutex
Mutable
Embedding resources in executable using GCC
C++
C
Gcc
Resources
Embedded Resource
Why is the code in most STL implementations so convoluted?
C++
Stl
Readability
Launch Failed. Binary not found. CDT on Eclipse Helios
C++
C
Eclipse
Eclipse Plugin
Eclipse Cdt
Py_Initialize fails - unable to load the file system codec
C++
Python
How can I print 0x0a instead of 0xa using cout?
C++
Io
Iostream
Iomanip
BSTR to std::string (std::wstring) and vice versa
C++
String
Com
What is the size of a pointer?
C++
Pointers
Sizeof
Derived class with non-virtual destructor
C++
Are there practical uses for dynamic-casting to void pointer?
C++
Dynamic Cast
Easiest way of using min priority queue with key update in C++
C++
Algorithm
Data Structures
Split a string using C++11
C++
String
Split
C++11
How can I have multiple parameter packs in a variadic template?
C++
C++11
Variadic Templates
How to solve "Unresolved inclusion: <iostream>" in a C++ file in Eclipse CDT?
C++
Eclipse
Iostream
Is #pragma once a safe include guard?
C++
Include Guards
How can I iterate over an enum?
C++
Enums
Is the practice of returning a C++ reference variable evil?
C++
Reference
C++ Faq
What is meant by Resource Acquisition is Initialization (RAII)?
C++
Raii
cmath vs math.h (And similar c-prefixed vs .h extension headers)
C++
Header
Include
How to generate assembly code with clang in Intel syntax?
C++
Assembly
X86
Clang
Intel
How can I print out C++ map values?
C++
Dictionary
For Loop
Printing
Std Pair
PDF specifications for coders: Adobe or ISO?
C++
C
Pdf
Specifications
Why doesn't polymorphism work without pointers/references?
C++
Pointers
Polymorphism
Virtual
Why using the const keyword before and after method or function name?
C++
Create N-element constexpr array in C++11
C++
C++11
Constexpr
Array Initialization
Refactoring with C++ 11
C++
C++11
Refactoring
Poor memcpy Performance on Linux
C++
C
Linux
Memcpy
Numa
Why is value taking setter member functions not recommended in Herb Sutter's CppCon 2014 talk (Back to Basics: Modern C++ Style)?
C++
C++11
Stl
Clang doesn't see basic headers
C++
C++11
Clang
Clang++
Llvm Clang
Valgrind: Memory still reachable with trivial program using <iostream>
C++
Valgrind
C++ compilation bug?
C++
Gcc
Undefined Behavior
How to get image width and height in OpenCV?
Python
C++
Opencv
Error LNK2019 unresolved external symbol _main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)
C++
How do I write a range pipeline that uses temporary containers?
C++
Range V3
Assignment in C++ occurs despite exception on the right side
C++
C++14
Are there downsides to using std::string as a buffer?
C++
C++11
Stdstring
Compiler stops optimizing unused string away when adding characters
C++
Gcc
Compilation
Clang
Compiler Optimization
Why do you need to recompile C/C++ for each OS?
C++
C
Winapi
Compilation
Does C or C++ guarantee array < array + SIZE?
C++
C
Language Lawyer
Template typedefs - What's your work around?
C++
Templates
Type Safety
Have you used any of the C++ interpreters (not compilers)?
C++
Interpreter
Read Eval-Print-Loop
Reader/Writer Locks in C++
C++
Multithreading
Locking
What is the use of const overloading in C++?
C++
Function
Constants
Overloading
Is the return type part of the function signature?
C++
Function
Looking for C++ STL-like vector class but using stack storage
C++
Data Structures
Stl
Vector
static_cast with boost::shared_ptr?
C++
Boost
Shared Ptr
Static Cast
const reference parameters
C++
Printing an array in C++?
C++
Arrays
Printing
Reverse
Dereference vector pointer to access element
C++
Vector
Dereference
Is there any way to find the address of a reference?
C++
Reference
Where to declare/define class scope constants in C++?
C++
Constants
Declaration
Checking if an iterator is valid
C++
Stl
Iterator
Dereference
Why are global and static variables initialized to their default values?
C++
C
Static
Global Variables
Mixing extern and const
C++
C
Constants
Scope
Extern
Operator overloading outside class
C++
Operator Overloading
C/C++ function definitions without assembly
C++
Inline Assembly
Why is the volatile qualifier used through out std::atomic?
C++
C++11
Atomic
Volatile
append set to another set
C++
Insert
Set
F# performance in scientific computing
C++
Performance
F#
Parallel Processing
Scientific Computing
Can I use Qt without qmake or Qt Creator?
C++
Qt
Compilation
g++ linker: force static linking if static library exists?
C++
C
Linker
G++
Static Libraries
Creating shared_ptr from raw pointer
C++
What are inline namespaces for?
C++
Namespaces
C++11
Inline Namespaces
Can I call a base class's virtual function if I'm overriding it?
C++
Virtual Functions
Overriding
How does weak_ptr work?
C++
Boost
Weak References
Tr1
Weak Ptr
What is the fastest way to change a key of an element inside std::map
C++
Performance
Dictionary
Binary Tree
Std
Default variable value
C++
Get DLL path at runtime
C++
Dll
How to access the contents of a vector from a pointer to the vector in C++?
C++
Pointers
Vector
Why would one replace default new and delete operators?
C++
Operator Overloading
New Operator
C++ Faq
Delete Operator
const to Non-const Conversion in C++
C++
Constants
Static library debug symbols
C++
Visual Studio
Visual Studio-2010
GoogleTest vs CppUnit: The facts
C++
Unit Testing
Tdd
Googletest
Cppunit
what is the size of an enum type data in C++?
C++
Enums
Sizeof
Initializing container of unique_ptrs from initializer list fails with GCC 4.7
C++
Compiler Errors
Initialization
C++11
Does moving a vector invalidate iterators?
C++
Iterator
C++11
Using libstdc++ compiled libraries with clang++ -stdlib=libc++
C++
C++11
Clang
Libstdc++
Libc++
std::fstream buffering vs manual buffering (why 10x gain with manual buffering)?
C++
File
C++11
Buffer
Fstream
C++11 std::to_string(double) - No trailing zeros
C++
Stl
C++11
C++ Constructor/Destructor inheritance
C++
Inheritance
Constructor
Destructor
Destructor called after throwing from a constructor
C++
Exception
C++11
How do I create a new C++ project in Xcode?
C++
Xcode
xcode4.6
What's the difference between std::advance and std::next?
C++
C++11
Std
Using :: (scope resolution operator) in C++
C++
Function
Namespaces
Evaluate a string with a switch in C++
C++
Convert a vector<T> to initializer_list<T>
C++
C++11
Stl
Initializer List
When is it necessary to use the flag -stdlib=libstdc++?
C++
Gcc
C++11
Std
Libstdc++
How can I make CMake use GCC instead of Clang on Mac OS X?
C++
Cmake
Is there an equivalent to the "for ... else" Python loop in C++?
Python
C++
Loops
For Loop
Break
How does the standard library implement std::swap?
C++
Templates
Swap
Is the compiler allowed to optimize out heap memory allocations?
C++
Gcc
Optimization
Clang
Language Lawyer
If you're in the "we don't use exceptions" camp, then how do you use the standard library?
C++
Error Handling
Exception Handling
Why does this delay-loop start to run faster after several iterations with no sleep?
C++
Linux
Performance
Benchmarking
How the new range-based for loop in C++17 helps Ranges TS?
C++
C++11
For Loop
C++17
The use of double include guards in C++
C++
Macros
Linker
What is `constinit` in C++20?
C++
C++20
Constinit
When is it best to use the stack instead of the heap and vice versa?
C++
Why override operator()?
C++
Boost
Operator Overloading
Functor
Function Call-Operator
virtual inheritance
C++
Inheritance
Virtual
Padding stl strings in C++
C++
String
Padding
Stdstring
Is there an equivalent to WinAPI's MAX_PATH under linux/unix?
C++
C
Linux
Unix
Posix
How to include header files in GCC search path?
C++
Gcc
Header
Why should I not #include <bits/stdc++.h>?
C++
Portability
Turbo C++
C++ Faq
Implementation Defined-Behavior
C++11 reverse range-based for-loop
C++
C++11
Ranged Loops
How to use Boost in Visual Studio 2010
C++
Visual Studio-2010
Boost
Does return statement copy values
C++
Return
iterate vector, remove certain items as I go
C++
Data Structures
Vector
Loops
Iterator
Experiences using Wt C++ framework?
C++
Wt
Common reasons for bugs in release version not present in debug mode
C++
Release Mode
Debug Mode
Effect of using a comma instead of a semi-colon in C and C++
C++
C
Creating JSON arrays in Boost using Property Trees
C++
Json
Boost
Boost Propertytree
Unsigned double in C++?
C++
Double
Unsigned
C++ convert string to hexadecimal and vice versa
C++
String
Hex
Static variables in C++
C++
Static
Scope
What is a good naming convention for vars, methods, etc in C++?
C++
Naming Conventions
5 years later, is there something better than the "Fastest Possible C++ Delegates"?
C++
Delegates
Performance
Fastest way to get the integer part of sqrt(n)?
C++
C
Algorithm
Math
Performance
What can make C++ RTTI undesirable to use?
C++
Llvm
Rtti
C++ ifstream error using string as opening file path.
C++
Ifstream
Why do some people use swap for move assignments?
C++
C++11
Rvalue Reference
Move Semantics
Copy and-Swap
Is there a way to get the string representation of HRESULT value using win API?
C++
Windows
Winapi
Clr
Hresult
When does Endianness become a factor?
C++
Networking
Stl
Endianness
What is a constant reference? (not a reference to a constant)
C++
Reference
Constants
Is string::c_str() no longer null terminated in C++11?
C++
String
C++11
How and when to align to cache line size?
C++
C
Caching
Store derived class objects in base class variables
C++
Polymorphism
Object Slicing
There are no arguments that depend on a template parameter
C++
Templates
Why are string literals l-value while all other literals are r-value?
C++
C
Literals
String Literals
Vector of Vectors to create matrix
C++
Vector
Matrix
What is the performance penalty of C++11 thread_local variables in GCC 4.8?
C++
Linux
Multithreading
Gcc
C++11
How do I get the intersection between two arrays as a new array?
Java
C++
C
Algorithm
How std::function works
C++
C++11
Why is sizeof(unsigned double) equal to 4?
C++
Visual Studio-2010
C++ Lambdas: Difference between "mutable" and capture-by-reference
C++
C++11
Lambda
Why would you use the keyword const if you already know variable should be constant?
C++
C
Constants
Keyword
Why prefer signed over unsigned in C++?
C++
Optimization
What is decltype and how is it used?
C++
C++11
Decltype
Portable way of setting std::thread priority in C++11
C++
C++11
Portability
Stdthread
Thread Priority
What is the default hash function used in C++ std::unordered_map?
C++
C++11
Hash
Stl
Unordered Map
Including .cpp files
C++
How to mark a region so clang-format won't touch it?
C++
Clang Format
Is it legal for a C++ optimizer to reorder calls to clock()?
C++
Optimization
Clock
What is the difference between cbegin and begin for vector?
C++
Vector
Stl
Iterator
When should you use 'friend' in C++?
C++
Oop
Encapsulation
Friend
What XML parser should I use in C++?
C++
Xml Parsing
C++ Faq
Why would one use MACRO+0 !=0
C++
C
Why is std::fill(0) slower than std::fill(1)?
C++
Performance
X86
Compiler Optimization
Memset
What is the best way of testing private methods with GoogleTest?
C++
Unit Testing
Private
Googletest
std::tuple sizeof, is it a missed optimization?
C++
Tuples
Language Lawyer
Padding
Why don't I need to specify "typename" before a dependent type in C++20?
C++
Templates
Language Lawyer
C++20
Typename
What are your favorite C++ Coding Style idioms
C++
Coding Style
What do 1.#INF00, -1.#IND00 and -1.#IND mean?
C++
C
Why is strncpy insecure?
C++
C
String
Strncpy
Using Boost to read and write XML files
C++
Xml
Boost
GCC C++ Linker errors: Undefined reference to 'vtable for XXX', Undefined reference to 'ClassName::ClassName()'
C++
Linker
G++
Eclipse Cdt
std::set with user defined type, how to ensure no duplicates
C++
Set
default visibility of C++ class/struct members
C++
Class
Struct
Member
When a function has a specific-size array parameter, why is it replaced with a pointer?
C++
Arrays
Standards
Sizeof
Function Parameter
Are there binary memory streams in C++
C++
Iostream
how do aim bots in fps games work?
C++
C
Hook
How are exceptions implemented under the hood?
C++
Python
C
Exception
How do you read a segfault kernel log message
C++
C
Unix
Segmentation Fault
Syslog
C++: constructor initializer for arrays
C++
Constructor
Initializer
Equivalent of %02d with std::stringstream?
C++
Formatting
Stringstream
Programmatically create static arrays at compile time in C++
C++
Metaprogramming
Static Array
How to publicly inherit from a base class but make some of public methods from the base class private in the derived class?
C++
Better variable exploring when debugging C++ code with Eclipse/CDT
C++
Eclipse
Gdb
Eclipse Cdt
switch "transfer of control bypasses initialization of:" when calling a function
C++
Function
Switch Statement
Portably safe to pass NULL/zero to dynamic_cast?
C++
Null
Dynamic Cast
Google C++ style guide's No-exceptions rule; STL?
C++
Exception
Stl
Uses of unnamed namespace in C++
C++
Namespaces
Extension methods in c++
C++
C++11
The compiler is complaining about my default parameters?
C++
Class
Optional Parameters
Should I switch from using boost::shared_ptr to std::shared_ptr?
C++
Boost
Stl
C++11
Shared Ptr
How to generate CMakeLists.txt?
C++
C
Cmake
How to avoid precompiled headers
C++
Visual Studio
Visual Studio-2010
Detect Windows or Linux in C, C++
C++
C
Windows
Linux
'cl' is not recognized as an internal or external command,
C++
Qt
Concurrency: Atomic and volatile in C++11 memory model
C++
Multithreading
Concurrency
C++11
Parallel Processing
how does the ampersand(&) sign work in c++?
C++
Pointers
Reference
Ampersand
How to update GCC in MinGW on Windows?
C++
Gcc
C++11
Mingw
Difference between C++11 std::bind and boost::bind
C++
C++11
Boost
Boost Bind
Stdbind
How to implement multithread safe singleton in C++11 without using <mutex>
C++
Multithreading
C++11
Singleton
Atomic
Why is C++ allowing me to assign a const char to a const char *?!
C++
Implicit Conversion
Type Safety
Serializing and deserializing JSON with Boost
C++
Json
Boost
Boost Propertytree
How to convert a lambda to an std::function using templates
C++
Function
Templates
C++11
Lambda
How to output a character as an integer through cout?
C++
Io
Type Conversion
Iostream
Outputstream
C++ local variable destruction order
C++
C++11
Destructor
Local Variables
How can I make an unordered set of pairs of integers in C++?
C++
Std Pair
Unordered Set
When should you use constexpr capability in C++11?
C++
C++11
Constexpr
Determine if two rectangles overlap each other?
C++
Algorithm
Geometry
Overlap
Rectangles
C++ Loop through Map
C++
Dictionary
Case-insensitive string comparison in C++
C++
String
How to round up the result of integer division?
Java
C#
C++
Math
Can I use break to exit multiple nested 'for' loops?
C++
For Loop
Break
Nested Loops
Difference between passing array, fixed-sized array and base address of array as a function parameter
C++
Arrays
Pointers
How to convert QString to int?
C++
String
Qt
Int
Qstring
Pointer values are different but they compare equal. Why?
C++
Pointers
Multiple Inheritance
C++ - meaning of a statement combining typedef and typename
C++
Typedef
Typename
Why do I get the same sequence for every run with std::random_device with mingw gcc4.8.1?
C++
C++11
Random
Stl
error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj
C++
Visual Studio-2010
Visual C++
Msbuild
I'm getting an error "invalid use of incomplete type 'class map'
C++
How to convert vector to set?
C++
Vector
Set
What is the recommended way to align memory in C++11
C++
C++11
Dynamic Memory-Allocation
Memory Alignment
Does C++ pass objects by value or reference?
C++
Pass by-Reference
Pass by-Value
Pass by-Pointer
Strange code that compiles with g++
C++
Gcc
C++11
G++
Why does bool and not bool both return true in this case?
C++
Boolean
C++11 initializer list fails - but only on lists of length 2
C++
C++11
Initializer List
The difference between C and C++ regarding the ++ operator
C++
C
Increment
Prefix
What kind of optimization does const offer in C/C++?
C++
C
Constants
Compiler Optimization
Why was the space character not chosen for C++14 digit separators?
C++
Language Lawyer
C++14
Digit
Is it legal to compare dangling pointers?
C++
Pointers
Language Lawyer
Dangling Pointer
Why does the compiler match "char" to "int" but not "short"?
C++
Type Conversion
Overloading
Language Lawyer
constexpr vs. static const: Which one to prefer?
C++
C++11
Constants
Constexpr
Why won't this compile without a default constructor?
C++
Constructor
Scope
Default Constructor
Most Vexing-Parse
Is copying 2D arrays with "memcpy" technically undefined behaviour?
C++
C
Multidimensional Array
Language Lawyer
Undefined Behavior
Garbage collection Libraries in C++
C++
Garbage Collection
Libraries
Where can I learn more about C++0x?
C++
C++11
Reference Manual
Why must const members be initialized in the constructor initializer rather than in its body?
C++
Constructor
Initialization
Constants
Extending python - to swig, not to swig or Cython
Python
C++
C
Swig
Cython
difference between a pointer and reference parameter?
C++
Pointers
Reference
Object Slicing
Returning a pointer to a vector element in c++
C++
Pointers
Containers
Iterator
How would you implement a basic event-loop?
C++
Python
Blocking
Event Loop
How to open an std::fstream (ofstream or ifstream) with a unicode filename?
C++
Windows
Unicode
What is the difference between ImageMagick and GraphicsMagick?
C++
Image
Imagemagick
Comparison
Graphicsmagick
How do I convert a long to a string in C++?
C++
C++ tutorial for experienced C programmer
C++
Propagating 'typedef' from based to derived class for 'template'
C++
Templates
Inheritance
Typedef
Name Lookup
What's the right way to overload operator== for a class hierarchy?
C++
Operator Overloading
Prevent class inheritance in C++
C++
Inheritance
Controls
Generate sha256 with OpenSSL and C++
C++
Unix
Openssl
Sha256
When to use recursive mutex?
C++
Multithreading
Recursion
Mutex
Recursive Mutex
Why aren't static const floats allowed?
C++
Visual C++
Qt Linker Error: "undefined reference to vtable"
C++
Qt
Linker Errors
Vtable
Qobject
Is it possible to force a function not to be inlined?
C++
Visual C++
Using Visual Studio project properties effectively for multiple projects and configurations
C++
Visual Studio-2010
Visual Studio
Build
Projects and-Solutions
Reverse iteration with an unsigned loop variable
C++
For Loop
Is there any way to make Visual Studio stop indenting namespaces?
C++
Visual Studio
Namespaces
Indentation
What is wrong with making a unit test a friend of the class it is testing?
C++
Unit Testing
Oop
Encapsulation
Friend
Escape sequence \f - form feed - what exactly is it?
C++
Escaping
int vs const int&
C++
Coding Style
Reference
Constants
Q_OBJECT throwing 'undefined reference to vtable' error
C++
Qt
Linker Errors
Vtable
invalid conversion from `void*' to `char*' when using malloc?
C++
G++
Malloc
how to make an application thread safe?
C++
C
Multithreading
Concurrency
Thread Safety
Lambda expressions as class template parameters
C++
Templates
Lambda
C++11
casting non const to const in c++
C++
Types
Casting
Constants
PCH Warning: header stop cannot be in a macro or #if block - Visual C++ 2010 Express SP1
C++
Visual C++
How to check if a CPU supports the SSE3 instruction set?
C++
Sse
Instruction Set
Avx
Cpuid
C++ trying to swap values in a vector
C++
Vector
Swap
Is main() overloaded in C++?
C++
Overloading
Main
How to implement the factory method pattern in C++ correctly
C++
Design Patterns
Idioms
Factory Method
What legitimate reasons exist to overload the unary operator&?
C++
Operator Overloading
Enum variable default value?
C++
Variables
Enums
Default Value
Why main() in C++ cannot be inlined?
C++
Inline
Main
How should I write ISO C++ Standard conformant custom new and delete operators?
C++
Operator Overloading
New Operator
C++ Faq
Delete Operator
What are qualified-id/name and unqualified-id/name?
C++
Why doesn't left bit-shift, "<<", for 32-bit integers work as expected when used more than 32 times?
C++
Bit Shift
To GC or Not To GC
C++
Performance
Garbage Collection
D
Heap Memory
GCC worth using on Windows to replace MSVC?
C++
Windows
Visual C++
Gcc
C++11
Using C++ base class constructors?
C++
Inheritance
Constructor
C++11
How to write C++ comments that show up in Intellisense?
C++
Visual Studio
Visual Studio-2010
Documentation
Intellisense
Error QApplication: no such file or directory
C++
Qt
How to open a link in a default user browser in Qt?
C++
Qt
What's the difference between "static" and "dynamic" schedule in OpenMP?
C++
Multithreading
Openmp
Is std::stoi actually safe to use?
C++
Standards
Language Lawyer
Does Arduino use C or C++?
C++
C
Arduino
Why is my log in the std namespace?
C++
Namespaces
Overloading
How to call through a member function pointer?
C++
Function Pointers
Can we have recursive macros?
C++
C
Macros
C Preprocessor
How to convert std::chrono::time_point to calendar datetime string with fractional seconds?
C++
Datetime
C++11
Std
Chrono
Is there a compact equivalent to Python range() in C++/STL
C++
Python
How to document C++ templates and template metafunctions with doxygen?
C++
Templates
Doxygen
How to recompile with -fPIC
C++
Gcc
Compilation
Ffmpeg
Fpic
Why does std::map not have a const accessor?
C++
C++11
Std
How to write custom input stream in C++
C++
Iostream
Complex C declaration
C++
C
Function Pointers
Declaration
C++: Mysteriously huge speedup from keeping one operand in a register
C++
C
Performance
Optimization
Assembly
How to create/read/write JSON files in Qt5
C++
Json
Qt
Qt5
understanding of pthread_cond_wait() and pthread_cond_signal()
C++
Multithreading
Mutex
Why I have to write std::cout and not also std::<<
C++
C++14 Variable Templates: what is their purpose? Any usage example?
C++
Templates
C++14
How does C++ STL unordered_map resolve collisions?
C++
Stl
Unordered Map
What are the differences between C-like, constructor, and uniform initialization?
C++
C++11
Initialization
C++03
Variable Initialization
What's the benefit of std::back_inserter over std::inserter?
C++
Vector
Stl
Iterator
Containers
error: passing 'const …' as 'this' argument of '…' discards qualifiers
C++
Why does C++ promote an int to a float when a float cannot represent all int values?
C++
Types
Int
Floating Point-Conversion
Promotions
Why can't a weak_ptr be constructed from a unique_ptr?
C++
Shared Ptr
Smart Pointers
Unique Ptr
Weak Ptr
How to write C/C++ code correctly when null pointer is not all bits zero
C++
C
Computer Architecture
Why not call nullptr NULL?
C++
C++11
Language Design
Definitive List of Common Reasons for Segmentation Faults
C++
C
Segmentation Fault
gsl::not_null<T*> vs. std::reference_wrapper<T> vs. T&
C++
Pointers
Cpp Core-Guidelines
Guideline Support-Library
Can using a lambda in header files violate the ODR?
C++
C++11
Lambda
Language Lawyer
One Definition-Rule
Return void type in C and C++
C++
C
Gcc
Clang
Language Lawyer
Initializing an array of zeroes
C++
Arrays
Initialization
Language Lawyer
Why is the construction of std::optional<int> more expensive than a std::pair<int, bool>?
C++
Performance
Assembly
X86 64
C++17
How to read audio data from a 'MediaStream' object in a C++ addon
Javascript
C++
Electron
V8
Blink
Why does using the ternary operator to return a string generate considerably different code from returning in an equivalent if/else block?
C++
Assembly
Optimization
Clang
Compiler Optimization
Fast String Hashing Algorithm with low collision rates with 32 bit integer
C++
Algorithm
String
Hash
How much overhead is there in calling a function in C++?
C++
Function
Overhead
Finding C++ static initialization order problems
C++
Initialization
Static Order-Fiasco
.o files vs .a files
C++
C
Linux
Gcc
Build Process
Performance hit from C++ style casts?
C++
Performance
Casting
How to create a UTF-8 string literal in Visual C++ 2008
C++
Visual C++
Utf 8
Avoiding unused variables warnings when using assert() in a Release build
C++
Warnings
Assertions
Will my iPhone app take a performance hit if I use Objective-C for low level code?
C++
Iphone
Objective C
Performance
Optimization
How to make a function return a pointer to a function? (C++)
C++
Return Value
Function Pointers
Cycles in family tree software
C++
Graph
Cycle
Assertions
Family Tree
Replacing a 32-bit loop counter with 64-bit introduces crazy performance deviations with _mm_popcnt_u64 on Intel CPUs
C++
Performance
Assembly
X86
Compiler Optimization
Compiling an application for use in highly radioactive environments
C++
C
Gcc
Embedded
Fault Tolerance
What are rvalues, lvalues, xvalues, glvalues, and prvalues?
C++
Expression
C++ Faq
C++11
Why do we need virtual functions in C++?
C++
Polymorphism
Virtual Functions
Combining C++ and C - how does #ifdef __cplusplus work?
C++
C
C Preprocessor
Extern C
When are static C++ class members initialized?
C++
Static
Initialization
C++, How to determine if a Windows Process is running?
C++
Windows
Process
How to compile C code with anonymous structs / unions?
C++
C
Struct
Anonymous
Unions
Linking different libraries for Debug and Release builds in Cmake on windows?
C++
Windows
Cmake
C++ alignment when printing cout <<
C++
Stdout
Cout
Text Alignment
What are the definitions for LPARAM and WPARAM?
C#
C++
Windows
How to change a particular element of a C++ STL vector
C++
Stl
Vector
Problem calling std::max
C++
Windows
Visual C++
Bison
how to catch unknown exception and print it
C++
Exception
Intrusive lists
C++
C
Defining operator< for a struct
C++
Operator Overloading
What's up with the thousands of warnings in standard headers in MSVC -Wall?
C++
Visual C++
Compiler Warnings
How to get a stack trace for C++ using gcc with line number information?
C++
Linux
Gcc
Stack Trace
With "-fno-exceptions", what happens with "new T"?
C++
Exception
Does C++ support compile-time counters?
C++
Templates
Metaprogramming
State
How to compile/link Boost with clang++/libc++?
C++
Boost
Clang
Libc++
What is the best way to return string in C++?
C++
String
Constant-sized vector
C++
Stl
Vector
Returning temporary object and binding to const reference
C++
Reference
Constants
Why does C++ output negative numbers when using modulo?
C++
Standards
Modulo
Pointer to incomplete class type is not allowed
C++
List
Class
Pointers
Iterator
ctypes error: libdc1394 error: Failed to initialize libdc1394
Python
C++
Shared Libraries
Ctypes
Libdc1394
How do I avoid implicit conversions on non-constructing functions?
C++
Function
Casting
Implicit Conversion
When does a constexpr function get evaluated at compile time?
C++
C++11
Runtime
Compile Time
Constexpr
Why are Cdecl calls often mismatched in the "standard" P/Invoke Convention?
C#
C++
Pinvoke
Stdcall
Cdecl
Are lambdas inlined like functions in C++?
C++
C++11
Lambda
Stl
MinGW .exe requires a few gcc dll's regardless of the code?
C++
Dll
Mingw
Lambda functions as base classes
C++
C++11
Lambda
In a lambda, does a by-value capture of a reference copy the underlying object?
C++
C++11
Lambda
DSO missing from command line
C++
Linux
G++
Undefined Reference
Performance issue: Java vs C++
Java
C++
Performance
Algorithm
Lambda-Over-Lambda in C++14
C++
Lambda
C++14
What is an `int foo::*bar::*`?
C++
Pointer to-Member
void_t "can implement concepts"?
C++
Templates
C++11
Template Meta-Programming
C++ Concepts
Return value optimization and copy elision in C
C++
C
Struct
Return Value-Optimization
Copy Elision
Define preprocessor macro through CMake?
C++
Cmake
C Preprocessor
How do I print out the contents of a vector?
C++
Vector
Output
Stdvector
Cout
Is this std::ref behaviour logical?
C++
C++11
Ref
What does it mean to inherit from lambda?
C++
How can I get the penultimate element in a list?
C++
Stl
Stdlist
How can I insert element into beginning of vector?
C++
Visual C++
Vector
Std
Why does initialization of array of pairs still need double braces in C++14?
C++
C++14
Initializer List
Do I need to put constexpr after else-if?
C++
If Statement
C++17
If Constexpr
Exact moment of "return" in a C++-function
C++
Language Lawyer
C++17
Object Lifetime
Copy Elision
Multithreading program stuck in optimized mode but runs normally in -O0
C++
Multithreading
Thread Safety
Undefined Behavior
Data Race
std::string s1 {"Modern C++", 3} vs std::string s1 {str, 3}
C++
String
C++17
Doesn't constraining the "auto" in C++ defeat the purpose of it?
C++
C++20
Auto
C++ Concepts
Std Integral
scope resolution operator without a scope
C++
Best way to store currency values in C++
C++
Currency
Static variables initialisation order
C++
Visual Studio
Gcc
Static
Linker
Dead code detection in legacy C/C++ project
C++
Automation
Static Analysis
Legacy Code
Dead Code
How do you flag code so that you can come back later and work on it?
C#
C++
Comments
Is f(void) deprecated in modern C and C++?
C++
C
Refactoring
Void
Is there a way to find all the functions exposed by a dll
C++
C
Winapi
Dll
boost serialization vs google protocol buffers?
C++
Performance
Serialization
Protocol Buffers
Boost Serialization
is size_t always unsigned?
C++
Standards
string::size_type instead of int
C++
String
Int
Size Type
How do I find the largest int in a std::set<int>?
C++
Stl
Stdset
Are static variables in a base class shared by all derived classes?
C++
Inheritance
Static
How do you initialise a dynamic array in C++?
C++
Arrays
What's the reasoning behind putting constants in 'if' statements first?
C++
Coding Style
Constants
If Statement
How do I specify an integer literal of type unsigned char in C++?
C++
Integer
Constants
Language Lawyer
Are there C++ equivalents for the Protocol Buffers delimited I/O functions in Java?
Java
C++
Serialization
Protocol Buffers
Where is `%p` useful with printf?
C++
C
Printf
Passing integers as constant references versus copying
C++
How do traits classes work and what do they do?
C++
Traits
Why do C++ objects have a default destructor?
C++
Constructor
Destructor
Default Constructor
error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
C++
Linker
Converting from signed char to unsigned char and back again?
C++
C
Java Native-Interface
C++ cast to derived class
C++
Inheritance
Enum to String C++
C++
Enums
Integrate type name in static_assert output?
C++
Templates
C++11
Custom Errors
Static Assert
C++11 lambda as member variable?
C++
C++11
Lambda
When should I use raw pointers over smart pointers?
C++
Pointers
Boost
Smart Pointers
identifier "string" undefined?
C++
String
How can I iterate over a packed variadic template argument list?
C++
C++11
Variadic Templates
A C++ implementation that detects undefined behavior?
C++
Undefined Behavior
C/C++ global vs static global
C++
C
Static
Global Variables
What is constructor inheritance?
C++
Inheritance
Constructor
C++11
Global scope vs global namespace
C++
Namespaces
Scope
Terminology
what's the point of std::unique_ptr::get
C++
C++11
Pointers
Unique Ptr
Overload bracket operators [] to get and set
C++
Indexing
Overloading
Square Bracket
Declaring variables inside loops, good practice or bad practice?
C++
Loops
Variable Declaration
C++ unordered_map using a custom class type as the key
C++
Hash
G++
Unordered Map
Hashtree
Variable number of arguments in C++?
C++
Variadic Functions
Start thread with member function
C++
Multithreading
C++11
std vector C++ -- deep or shallow copy
C++
Vector
Copy
Std
Deep Copy
Difference between rdtscp, rdtsc : memory and cpuid / rdtsc?
C++
C
Performance
Assembly
Rdtsc
😃 (and other Unicode characters) in identifiers not allowed by g++
C++
Gcc
Unicode
C++11
G++
Could a C++ implementation, in theory, parallelise the evaluation of two function arguments?
C++
Language Lawyer
std::put_time implementation status in GCC?
C++
Gcc
C++11
Std
Chrono
C++ std::vector emplace vs insert
C++
Vector
Stl
Can I turn unsigned char into char and vice versa?
C++
C
Extract year/month/day etc. from std::chrono::time_point in C++
C++
Time
C++11
Chrono
Why can't a derived class call protected member function in this code?
C++
Oop
Must I call atomic load/store explicitly?
C++
C++11
Atomic
Pass multiple arguments into std::thread
C++
Multithreading
C++11
What is C# equivalent of <map> in C++?
C#
C++
Dictionary
Visual C++
Language Comparisons
Why can't GCC optimize the logical / bitwise AND pair in "x && (x & 4242)" to "x & 4242"?
C++
Gcc
Optimization
Compiler Optimization
How to create an std::function from a move-capturing lambda expression?
C++
Lambda
Std
C++14
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader
Android
C++
Swig
Android Library
C++ references - are they just syntactic sugar?
C++
Clang-format line breaks
C++
Clang
Code Formatting
Clang Format
If I want to round an unsigned integer to the closest smaller or equal even integer, can I divide by 2 then multiply by 2?
C++
C
Why can std:set (with a single colon) compile?
C++
Visual Studio
Why is statically linking glibc discouraged?
C++
C
Linker
Glibc
Static Linking
Are 'new' and 'delete' getting deprecated in C++?
C++
Arrays
Dynamic Memory-Allocation
Static Memory-Allocation
How can I distinguish between high- and low-performance cores/threads in C++?
C++
Multithreading
Performance
Intel
Apple M1
C/C++ source code visualization?
C++
C
Visualization
How can I avoid the Diamond of Death when using multiple inheritance?
C++
Multiple Inheritance
How much null checking is enough?
C#
Java
C++
Design by-Contract
How to use makefiles in Visual Studio?
C++
Visual Studio
Makefile
Why do we actually need Private or Protected inheritance in C++?
C++
Inheritance
Private
Protected
C++ Faq
How to convert a single char into an int
C++
Char
C++ getters/setters coding style
C++
Coding Style
Getter Setter
64 bit ntohl() in C++?
C++
Linux
64 Bit
Endianness
How can I get a process handle by its name in C++?
C++
Winapi
Process
Trie implementation
C++
C
Data Structures
Trie
What Happens When Stack and Heap Collide
C++
C
Memory
Heap Memory
Stack Memory
How do you generate a random double uniformly distributed between 0 and 1 from C++?
C++
Random
Ambiguous overload call to abs(double)
C++
Std
Cmath
C++ Remove new line from multiline string
C++
String
Multiline
When and how to use GCC's stack protection feature?
C++
Gcc
Stack
Protection
How to declare a static const char* in your header file?
C++
Constants
What's the differences between .dll , .lib, .h files?
C++
Windows
Dll
Header Files
Explicitly exporting shared library functions in Linux
C++
Linux
What is the type of string literals in C and C++?
C++
C
String
Constants
Why does C++ not have reflection?
C++
Reflection
How do I output coloured text to a Linux terminal?
C++
Linux
Colors
Terminal
Sorting a vector in descending order
C++
Sorting
Stl
Vector
Iterator
How do I check if a C++ std::string starts with a certain string, and convert a substring to an int?
C++
String
Parsing
Substring
Startswith
Can a class member function template be virtual?
C++
Templates
Virtual Functions
Function Templates
C++ Faq
Is there any way a C/C++ program can crash before main()?
C++
C
Function
Crash
c++ undefined references with static library
C++
Static Libraries
Does C++ limit recursion depth?
C++
Recursion
Limit
Iterator to last element in std::list
C++
Stl
Tail recursion in C++
C++
Recursion
G++
Tail Recursion
immutable strings vs std::string
C++
String
Immutability
How to declare a templated struct/class as a friend?
C++
Templates
Friend
How to increase thread priority in pthreads?
C++
Linux
Multithreading
Pthreads
vector<int>::size_type in C++
C++
Vector
Size Type
Are C++ enums slower to use than integers?
C++
Enums
Profiling
Performance
How do boost::variant and boost::any work?
C++
Unions
Boost Variant
Boost Any
redirect stdout/stderr to a string
C++
C
Stdout
Stderr
C++ pure virtual function have body
C++
Pure Virtual
Why use QVector(Qt) instead of std::vector
C++
Qt
Vector
Why should one not derive from c++ std string class?
C++
String
Inheritance
Stl
know if .lib is static or import
C++
C
Windows
Dll
Why does unique_ptr have the deleter as a type parameter while shared_ptr doesn't?
C++
Smart Pointers
Type Erasure
How can I build a C++ project with multiple interdependent subdirectories?
C++
Cmake
How to get a random element from a C++ container?
C++
Algorithm
Stl
When to use const char * and when to use const char []
C++
C
Converting C++ class to JSON
C++
Json
Serialization
Array placement-new requires unspecified overhead in the buffer?
C++
Memory Management
Standards
Placement New
c++ array - expression must have a constant value
C++
Arrays
inline function members inside a class
C++
Class
Methods
Can we have a static virtual functions? If not, then WHY?
C++
Static Methods
Virtual Functions
std::thread - naming your thread
C++
Multithreading
C++11
How can I use C++ 11 features in Clang?
C++
C++11
Clang
C++ delete vector, objects, free memory
C++
Vector
Delete Operator
Linker returns "relocation has an invalid symbol at symbol index..."
C++
Ubuntu
G++
C++ ifstream failbit and badbit
C++
File Io
Ifstream
Workarounds for no 'rvalue references to *this' feature
C++
C++11
Move Semantics
Rvalue Reference
How do I get a const_iterator using auto?
C++
C++11
Auto
What does "cv-unqualified" mean in C++?
C++
C++ Faq
Correct usage of rvalue references as parameters
C++
C++11
Rvalue Reference
C++ inserting unique_ptr in map
C++
Pointers
Map
Stl
Unique Ptr
C++11 Range-based for-loop efficiency "const auto &i" versus "auto i"
C++
For Loop
C++11
Auto
Iterating through vector<unique_ptr<mytype>> using C++11 for() loops
C++
C++11
Vector
Unique Ptr
Understanding glm::lookAt()
C++
Opengl
Glm Math
Technically, how do variadic functions work? How does printf work?
C++
C
Variadic Functions
Capturing perfectly-forwarded variable in lambda
C++
C++11
Lambda
C++14
Perfect Forwarding
Best way to extract a subvector from a vector?
C++
Stl
Vector
Range
Does final imply override?
C++
Overriding
Final
Virtual Functions
Missing C++ header <__debug> after updating OSX Command Line Tools 6.3
C++
Xcode
Macos
Stl
Clang
MSVCP140.dll missing
C++
Windows
Visual Studio-2015
De Morgan's Law optimization with overloaded operators
C++
Operator Overloading
Language Lawyer
Compiler Optimization
Could it be the case that sizeof(T*) != sizeof(const T*)?
C++
Language Lawyer
Parallel Loops in C++
C++
C++11
For Loop
Concurrency
C++14
Difference between "if constexpr()" Vs "if()"
C++
If Statement
Constexpr
C++17
Slicing a vector in C++
Python
C++
Vector
Slice
non-defaulted operator <=> doesn't generate == and != in C++20
C++
C++20
Spaceship Operator
What is a good OO C++ wrapper for sqlite
C++
Database
Sqlite
C / C++ compiler warnings: do you clean up all your code to remove them or leave them in?
C++
C
Compiler Construction
Warnings
How do I make Visual Studio pause after executing a console application in debug mode?
C++
Visual Studio
Unit Testing
Boost
Console
I want to convert std::string into a const wchar_t *
C++
Stl
Wchar T
Stdstring
C++ extend a vector with another vector
C++
Vector
Mixing Qt and Boost
C++
Qt
Boost
Destructors of builtin types (int, char etc..)
C++
Constructor
Destructor
Typedef
Using enum inside types - Compiler warning C4482 C++
C++
Enums
Compiler Warnings
How to get IP address of boost::asio::ip::tcp::socket?
C++
Networking
Boost
Boost Asio
Why Switch/Case and not If/Else If?
C++
C
Switch Statement
Conditional Statements
Should I return std::strings?
C++
String
Return Value
How to check if a file exists and is readable in C++?
C++
Linux
File
Fstream
Exists
Convert RGB to Black & White in OpenCV
C++
C
Image Processing
Opencv
Computer Vision
How to get main window handle from process id?
C++
Windows
Winapi
Windows 7
Easiest way to rotate by 90 degrees an image using OpenCV?
C++
Image
Opencv
Rotation
Finding "dead code" in a large C++ legacy application
C++
Visual C++
Legacy
Catch Multiple Custom Exceptions? - C++
C++
Try Catch
Custom Exceptions
What should be contained in a global source code control ignore pattern for Visual Studio 2010?
C++
Visual Studio-2010
Visual Studio
Version Control
Ignore
Illegal token on right side of ::
C++
Linux
Winapi
Why do some people prefer "T const&" over "const T&"?
C++
Syntax
Pointers
Reference
Types
Is there a sorted_vector class, which supports insert() etc.?
C++
Stl
Vector
Sorting
Set
Clean Eclipse Index, it is out of sync with code
C++
Eclipse
Eclipse Cdt
What are all the member-functions created by compiler for a class? Does that happen all the time?
C++
Member Functions
C++ Faq
Qt - remove all widgets from layout?
C++
Qt
Mobile
Qt4
Nokia
Dependency Injection framework for C++
C++
Dependency Injection
Removing item from vector while iterating?
C++
Stl
Iterator
If I use C-Style casts in my C++ project, is it worth refactoring to C++ casts?
C++
Refactoring
Casting
Does set_target_properties in CMake override CMAKE_CXX_FLAGS?
C++
Cmake
Compiler Flags
One liner to convert from list<T> to vector<T>
C++
Stl
Why there is no pop_front method in C++ std::vector?
C++
Vector
How can I use Standard Library (STL) classes in my dll interface or ABI?
C++
Dll
C++11
Stl
Std
linux/videodev.h : no such file or directory - OpenCV on ubuntu 11.04
C++
Opencv
Ubuntu 11.04
How to parse ini file with Boost
C++
Parsing
Boost
Ini
WChars, Encodings, Standards and Portability
C++
Unicode
Wchar T
Easy way to remove extension from a filename?
C++
Is constexpr supported with lambda functions / expressions?
C++
C++11
Lambda
Constexpr
reading a line from ifstream into a string variable
C++
String
Ifstream
Getline
Floating point comparison
C++
C
Floating Point
Template Specialization VS Function Overloading
C++
Stl
Template Specialization
Standard Library
Overloading
std::transform() and toupper(), no matching function
C++
Algorithm
Stl
strdup or _strdup?
C++
C
Visual Studio
Strdup
Printing additional output in Google Test
C++
Googletest
Print out the values of a (Mat) matrix in OpenCV C++
C++
Opencv
malloc() vs. HeapAlloc()
C++
Winapi
Malloc
Is there a null std::ostream implementation in C++ or libraries?
C++
Null
Ostream
CMake with include and source paths - basic setup
C++
Cmake
Identifier not found error on function call
C++
Compiler Errors
Enhanced FOR loops in C++
Java
C++
For Loop
Const correctness in C vs C++
C++
C
Constants
Why isn't there a std::shared_ptr<T[]> specialisation?
C++
C++11
Shared Ptr
How to deal with bad_alloc in C++?
C++
Memory Management
Bad Alloc
Easily measure elapsed time
C++
C
Linux
Time
Measurement
int a[] = {1,2,}; Why is a trailing comma in an initializer-list allowed?
C++
Syntax
Grammar
Language Lawyer
What is the difference between the dot (.) operator and -> in C++?
C++
Operators
std::string::c_str() and temporaries
C++
Stl
Stdstring
Object creation on the stack/heap?
C++
Initialization
Heap Memory
Stack Memory
non-member function cannot have cv-qualifier
C++
Templates
Constants
cmake - find_library - custom library location
C++
Windows
Cmake
decltype vs auto
C++
Type Inference
What is the difference between "++" and "+= 1 " operators?
C++
Loops
Integer
Auto Increment
Increment
Why can't we declare a namespace within a class?
C++
Class
Namespaces
Why does the STL/Boost C++ coding style differ so much from everyone elses?
C++
Coding Style
Naming Conventions
How can I get a field from the last element of a vector in C++?
C++
Vector
Structure
Why do you use std::move when you have && in C++11?
C++
C++11
Move Semantics
Simple dictionary in C++
C++
Map
Dictionary
Where is the 'this' pointer stored in computer memory?
C++
This Pointer
What is the meaning of `???-` in C++ code?
C++
Trigraphs
Override identifier after destructor in C++11
C++
C++11
Overriding
Virtual Destructor
Overload resolution between object, rvalue reference, const reference
C++
C++11
Overloading
Rvalue Reference
C++14
Recommended values for OpenCV detectMultiScale() parameters
C++
Opencv
Cascade Classifier
How to get the real and total length of char * (char array)?
C++
C
Arrays
Pointers
Char
Rotate an image without cropping in OpenCV in C++
C++
Opencv
Is it a premature optimization to use std::move()?
C++
C++11
Can clang format add braces to single line if statements etc
C++
Clang
Clang Format
Storing 8 logical true/false values inside 1 byte?
C++
Bit Fields
How to make an expandable/collapsable section widget in Qt
C++
Qt
Widget
Custom Controls
Qwidget
What does (number & -number) mean in bit programming?
C++
Bit
Bitwise And
Fenwick Tree
I cannot pass lambda as std::function
C++
C++11
Lambda
Difference between CMake and NDK-build in android studio project
Android
C++
Android Studio
Android Ndk
Ndk Build
What does [&] mean before function?
C++
default override of virtual destructor
C++
C++11
C++14
Where to use std::variant over union?
C++
C++17
Are all integer values perfectly represented as doubles?
C++
Double
Standards
Precision
Ieee 754
Functional programming in C++. Implementing f(a)(b)(c)
C++
C++11
Functional Programming
Currying
Std Function
What does C++ syntax “A::B:A {};” mean
C++
Struct
Syntax
Scope Resolution
What is the following list of behind the scenes inside the range-based for loop?
C++
For Loop
Does int main() need a declaration on C++?
C++
Main
Forward Declaration
Function Declaration
Why don't modern compilers coalesce neighboring memory accesses?
C++
Assembly
Optimization
Compiler Optimization
How could I graphically display the memory layout from a .map file?
C++
C
Linker
Calling python from a c++ program for distribution
C++
Python
Embedded Language
Which Javascript engine would you embed in your application?
Javascript
C++
Embed
Is ncurses available for windows?
C++
C
Ncurses
What is the most elegant way to read a text file with c++?
C++
Text
File Io
Is list::size() really O(n)?
C++
List
Stl
Complexity Theory
Big O
Can someone explain this template code that gives me the size of an array?
C++
Arrays
Templates
Size
Writing function definition in header files in C++
C++
Performance
Header Files
What exactly is va_end for? Is it always necessary to call it?
C++
C
Variadic Functions
How to implement an STL-style iterator and avoid common pitfalls?
C++
Iterator
Const Iterator
Update GCC on OSX
C++
Macos
Gcc
Compiler Construction
G++
Compile a DLL in C/C++, then call it from another program
C++
C
Gcc
Vb6
Mingw
Can I write C++ code without headers (repetitive function declarations)?
C++
Header
Header Files
Why should I use asserts?
C++
Performance
Assertions
std::endl is of unknown type when overloading operator<<
C++
Stl
Operator Overloading
Delete all items from a c++ std::vector
C++
Stl
Vector
Why does the = operator work on structs without having been defined?
C++
Gcc
Operators
C++ "multiple types in one declaration" error
C++
Why is argc an 'int' (rather than an 'unsigned int')?
C++
C
Command Line
In what ways do C++ exceptions slow down code when there are no exceptions thown?
C++
Exception
Overhead
Is it possible to print out the size of a C++ class at compile-time?
C++
How do I call C++/CLI from C#?
C#
C++
C++ Cli
Pinvoke
Managed C++
nm: "U" The symbol is undefined
C++
Linker
Development Environment
Separate "include" and "src" folders for application-level code?
C++
Project Management
Is there a C++11 syntax file for vim?
C++
Vim
C++11
C++ cannot convert from base A to derived type B via virtual base A
C++
Casting
Downcast
Virtual Inheritance
Static Cast
Contents of a static library
C++
C
Gcc
Static Libraries
Object Files
How to capture stdout/stderr with googletest?
C++
Unit Testing
Stdout
Stderr
Googletest
lambdas require capturing 'this' to call static member function?
C++
Lambda
C++11
What's the point of const void?
C++
C
Function
Constants
Void
How to check what shared libraries are loaded at run time for a given process?
C++
C
Linux
Shared Libraries
Reference of Reference in C++
C++
Automatic copy files to output during application building
C++
Visual Studio-2010
Visual C++
Msbuild
Have a static lib, is there a simple way to know it is for 32 bit or 64 bit?
C++
Windows
Visual C++
32bit 64bit
Programming languages that compile into C/C++ source?
C++
C
Programming Languages
Code Translation
Replace an element into a specific position of a vector
C++
Visual C++
Vector
Stl
Insert
What happens when an exception goes unhandled in a multithreaded C++11 program?
C++
Multithreading
Exception
C++11
C++ Faq
Metaprogramming in C++ and in D
C++
Metaprogramming
D
Why use endl when I can use a newline character?
C++
String Formatting
Iostream
Buffering
Can't Mod Zero?
C++
Modulo
Divide by-Zero
Lambda as function parameter
C++
Lambda
C++11
What are the differences between CV_8U and CV_32F and what should I worry about when converting between them?
C++
Opencv
Convert Eigen Matrix to C array
C++
Arrays
Matrix
Eigen
Return a 2d array from a function
C++
Multidimensional Array
Why are strings immutable in many programming languages?
Java
C++
String
Immutability
Remove a key from a C++ map
C++
Map
Why is size_t unsigned?
C++
Unsigned Integer
Size T
reading from stdin in c++
C++
Why std::cout instead of simply cout?
C++
Iostream
C++ preprocessor: avoid code repetition of member variable list
C++
Templates
Arguments
C Preprocessor
Getting a bunch of crosses initialization error
C++
G++
Initialization
Switch Statement
Get the compiler options from a compiled executable?
C++
C
Linux
Can a near-zero floating value cause a divide-by-zero error?
C++
C
Floating Point
Divide by-Zero
gmock setting default actions / ON_CALL vs. EXPECT_CALL
C++
Googlemock
Parallel for vs omp simd: when to use each?
C++
C
Performance
Openmp
Simd
Proper way of casting pointer types
C++
Pointers
Casting
Reinterpret Cast
Static Cast
When is uint8_t ≠ unsigned char?
C++
C
Types
Unsigned Char
Uint8t
Constexpr Math Functions
C++
C++11
Constexpr
Cmath
C++11 range-based for loops without loop variable
C++
C++11
What is the difference between assert and static_assert?
C++
Assert
Fastest implementation of sine, cosine and square root in C++ (doesn't need to be much accurate)
C++
Math
Optimization
Trigonometry
How to fix: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found
C++
Linux
Why does Visual Studio 2013 error on C4996?
C++
Visual Studio
Visual Studio-2013
What is a "span" and when should I use one?
C++
C++20
C++ Faq
Cpp Core-Guidelines
Std Span
Logical XOR operator in C++?
C++
Operators
Logical Operators
"Downcasting" unique_ptr<Base> to unique_ptr<Derived>
C++
C++11
Smart Pointers
Factory Pattern
Unique Ptr
How to cast the size_t to double or int C++
C++
Casting
Double
Size T
Specifying a concept for a type that has a member function template using Concepts Lite
C++
Higher Kinded-Types
C++ Concepts
CMake is not able to find BOOST libraries
C++
Bash
Boost
Cmake
Move-only version of std::function
C++
C++11
Move Semantics
Checking for existence in std::map - count vs find
C++
Dictionary
Stl
Stdmap
Why isn't `std::initializer_list` defined as a literal type?
C++
Language Lawyer
C++14
Initializer List
Constexpr
How to use the tool include-what-you-use together with CMake to detect unused headers?
C++
Cmake
Header Files
OpenCV undistortPoints and triangulatePoint give odd results (stereo)
C++
Opencv
Triangulation
Can I have Swift, Objective-C, C and C++ files in the same Xcode project?
C++
Objective C
C
Swift
Bridging Header
Iterating over different types
C++
C++11
C++14
Why isn't this 'for' loop valid?
C++
Arrays
C++11
Advantages of auto in template parameters in C++17
C++
Templates
Auto
C++17
Is it bad to declare a C-style string without const? If so, why?
C++
C
C Strings
Is there a difference between universal references and forwarding references?
C++
Templates
Perfect Forwarding
Universal Reference
Forwarding Reference
Difference between string.empty and string[0] == '\0'
C++
String
Performance difference between Windows and Linux using Intel compiler: looking at the assembly
C++
Assembly
X86 64
Icc
Intel Vtune
Cannot open include file: 'stdio.h' - Visual Studio Community 2017 - C++ Error
C++
Visual Studio
Visual Studio-2017
Stdio
Why isn't there a std::construct_at in C++17?
C++
C++17
Placement New
Heap corruption under Win32; how to locate?
C++
Windows
Multithreading
Debugging
Memory
Are C++ Templates just Macros in disguise?
C++
Templates
Macros
Difference between files written in binary and text mode
C++
C
File Io
C++ HTML template framework, templatizing library, HTML generator library
C++
Template Engine
Binary literals?
C++
Is there an implicit default constructor in C++?
C++
Constructor
What is the purpose of __cxa_pure_virtual?
C++
Avr Gcc
Pure Virtual
Listing header files in Visual Studio C++ project generated by cmake
C++
Visual Studio-2008
Cmake
Why there is no std::copy_if algorithm?
C++
Algorithm
Stl
C++ singleton vs. global static object
C++
Static
Singleton
Global Variables
How to convert Euler angles to directional vector?
C++
Math
Game Physics
"g++" and "c++" compiler
C++
Compiler Construction
Ubuntu
G++
How to print pthread_t
C++
C
Linux
Pthreads
Bind Vs Lambda?
C++
Functional Programming
Lambda
C++11
Bind
Inherit interfaces which share a method name
C++
Visual C++
Gcc
Multiple Inheritance
Is this self initialization valid?
C++
Initialization
Initialization Order
How usable is Qt without its preprocessing step?
C++
Qt
Should C++ 'interfaces' have a virtual destructor
C++
Is there some ninja trick to make a variable constant after its declaration?
C++
C++11
Const Correctness
Exceptions with Unicode what()
C++
C++11
Pure virtual functions may not have an inline definition. Why?
C++
Pure Virtual
Language Lawyer
When can compiling c++ without RTTI cause problems?
C++
Gcc
Rtti
How can I delete elements of a std::map with an iterator?
C++
Map
Iterator
Stdmap
Difference in make_shared and normal shared_ptr in C++
C++
C++11
Shared Ptr
Why is address of char data not displayed?
C++
Cout
Memory Address
Whyever **not** declare a function to be `constexpr`?
C++
C++11
Constants
Constexpr
Function Declaration
How to get IOStream to perform better?
C++
Optimization
Iostream
C++ Faq
C++ Standard-Library
std::string vs string in c++
C++
String
Std
Using C++ vector::insert() to add to end of vector
C++
Stl
Vector
Iterator
Declaring array of int
C++
Arrays
Pointers
Initialization
Multi-line DEFINE directives?
C++
C
Compiler Construction
placement new and delete
C++
Visual C++
New Operator
Placement
Using multiple .cpp files in c++ program?
C++
Function
When is the "typename" keyword necessary?
C++
Templates
Syntax
Typename
Does overloading '==' get you '!='?
C++
Why vector<bool>::reference doesn't return reference to bool?
C++
Compiler Errors
G++
Why can't clang with libc++ in c++0x mode link this boost::program_options example?
C++
Boost
C++11
Clang
Libc++
.template (dot-template) construction usage
C++
Templates
How do I use unique_ptr for pimpl?
C++
C++11
Pimpl Idiom
Unique Ptr
Is there a standard way of moving a range into a vector?
C++
C++11
Insert
Stdvector
Timing algorithm: clock() vs time() in C++
C++
Clock
Timing
Creating all possible k combinations of n items in C++
C++
Algorithm
Math
Combinations
Combinatorics
Can I typically/always use std::forward instead of std::move?
C++
C++11
Move Semantics
Rvalue Reference
Perfect Forwarding
Should all/most setter functions in C++11 be written as function templates accepting universal references?
C++
C++11
Move Semantics
Perfect Forwarding
Universal Reference
Using std::bind with member function, use object pointer or not for this argument?
C++
C++11
Language Lawyer
Why is so much space allocated on the stack?
C++
Compiler Construction
What is 1LL or 2LL in C and C++?
C++
C
Math
Long Integer
Cmath
Whats the difference between UInt8 and uint8_t
C++
Objective C
C
What is a dangling pointer?
C++
Pointers
Dangling Pointer
std::shared_ptr initialization: make_shared<Foo>() vs shared_ptr<T>(new Foo)
C++
C++11
Shared Ptr
Smart Pointers
How to create a thread pool using boost in C++?
C++
Boost
Threadpool
Boost Asio
Boost Thread
How do "acquire" and "consume" memory orders differ, and when is "consume" preferable?
C++
C++11
Atomic
Memory Model
How to Practically Ship GLSL Shaders with your C++ Software
C++
Opengl
Glsl
WebRTC AGC (Automatic Gain Control)
C++
Signal Processing
Webrtc
Is there a name for this tuple-creation idiom?
C++
Tuples
Variadic Templates
C++14
Generic Lambda
Static functions outside classes
C++
What does CV_8UC3 and the other types stand for in OpenCV?
C++
Opencv
C++ Comparison of String Literals
C++
String Literals
Arduino sprintf float not formatting
C++
Arduino
Printf
shared_from_this causing bad_weak_ptr
C++
Boost
Shared Ptr
C++ Faq
constexpr const vs constexpr variables?
C++
C++11
Constants
Constexpr
Why do the C++ language designers keep re-using keywords?
C++
C++11
Keyword
Language Design
Is catching an exception by reference dangerous?
C++
Exception
Should I default virtual destructors?
C++
C++11
Destructor
Virtual Functions
Is reusing a memory location safe?
C++
std::vector versus std::array in C++
C++
Arrays
Vector
Rule-of-Three becomes Rule-of-Five with C++11?
C++
Constructor
C++11
Rvalue Reference
Rule of-Three
How to throw a C++ exception
C++
Exception Handling
What is (x & 1) and (x >>= 1)?
C++
Bit Manipulation
Bitwise Operators
Bit Shift
Bitwise And
What's the proper way to enable AddressSanitizer in CMake that works in Xcode
C++
Cmake
Clang
Address Sanitizer
Can the compiler optimize from heap to stack allocation?
C++
Memory Management
Language Lawyer
Compiler Optimization
Install Qt on Ubuntu
C++
Linux
Qt
Ubuntu
What is consteval?
C++
C++20
Consteval
How does this template code to get the size of an array work?
C++
Visual C++
In C++, does initializing a global variable with itself have undefined behaviour?
C++
Language Lawyer
Undefined Behavior
What is the point of clog?
C++
Logging
Log4cpp
How to make thread sleep less than a millisecond on Windows
C++
Windows
Winapi
Sleep
Does "std::size_t" make sense in C++?
C++
Size T
Why use hex?
C++
C
Hex
Dynamically allocating an array of objects
C++
Memory Management
Pointers
Destructor
Copy Constructor
How to estimate the thread context switching overhead?
C++
C
Multithreading
Windows Mobile
Writing stringstream contents into ofstream
C++
Stl
Parameters
Stringstream
Ofstream
To GOTO or not to GOTO?
C++
Goto
virtual function call from base class
C++
Polymorphism
Virtual
Does std::vector.clear() do delete (free memory) on each element?
C++
Std
Question about a function definition (three dots in parameters..)
C++
C
Complete example using Boost::Signals for C++ Eventing
C++
Boost Signals
What's faster, iterating an STL vector with vector::iterator or with at()?
C++
Performance
Stl
Vector
Iterator
Is there a decent wait function in C++?
C++
Wait
Can you make custom operators in C++?
C++
Templates
Operators
C Preprocessor
Metaprogramming
How to use C++ classes with ctypes?
C++
Python
Ctypes
How to support both IPv4 and IPv6 connections
C++
Winsock
Ipv6
Sockets
Ipv4
Converting between C++ std::vector and C array without copying
C++
C
Arrays
Stl
Stdvector
Tricky interview subject for C++
C++
Function pointer as parameter
C++
Function
Pointers
Function Pointers
How to get installed Windows SDK version?
C++
Winapi
C++ Returning Pointers/References
C++
Pointers
Return
How can I print a list of elements separated by commas?
C++
Pretty Print
Separator
Prevent Firing Signals in Qt
C++
Qt
Checkbox
Signals Slots
Why is std::function not equality comparable?
C++
Function
Boost
C++11
Tr1
Visual Studio 2010 & 2008 can't handle source files with identical names in different folders?
C++
Visual Studio-2008
Visual Studio-2010
Naming Conventions
Projects and-Solutions
Meaning of U suffix
C++
C
Can we see the template instantiated code by C++ compiler
C++
Struct padding in C++
C++
Struct
Why was std::pow(double, int) removed from C++11?
C++
C++11
C++ Standard-Library
c++ boost split string
C++
Boost
Split
C++ priority_queue with lambda comparator error
C++
Stl
Lambda
C++11
Priority Queue
libstdc++-6.dll not found
C++
Mingw
Libraries
Pre & post increment operator behavior in C, C++, Java, & C#
C#
Java
C++
C
What does it mean to set the declaration of a function equal to 0? How can you assign an integer to a function?
C++
Windows
Oop
Winapi
Pure Virtual
Will (and should) there be sockets in C++11?
C++
Sockets
C++11
Emulate "double" using 2 "float"s
C++
Algorithm
Floating Point
Precision
Double Double-Arithmetic
What is the difference between static_cast and reinterpret_cast?
C++
C
Casting
Struct
Long Vs. Int C/C++ - What's The Point?
C++
C
Integer
Long Integer
How to convert char* to wchar_t*?
C++
Winapi
Unicode
Mingw
Type Conversion
How to properly replace global new & delete operators
C++
Windows
Memory Management
Visual Studio-2003
Why do std::string operations perform poorly?
C++
Python
Performance
node.js
Stl
Find OpenCV Version Installed on Ubuntu
C++
Opencv
Unexpected end of file error
C++
Visual Studio-2008
Visual C++
Compiler Errors
Precompiled Headers
Namespace + functions versus static methods on a class
C++
Namespaces
Static Methods
Is 0 a decimal literal or an octal literal?
C++
Zero
Octal
What is the easiest way to make a C++ program crash?
C++
Crash
C++ Structure Initialization
C++
How to implement classic sorting algorithms in modern C++?
C++
Algorithm
Sorting
C++14
C++ Faq
Deoptimizing a program for the pipeline in Intel Sandybridge-family CPUs
C++
Optimization
X86
Intel
Cpu Architecture
What's the most efficient way to erase duplicates and sort a vector?
C++
Sorting
Vector
Stl
Duplicates
Splitting a string by a character
C++
String
Algorithm
Eclipse CDT: Symbol 'cout' could not be resolved
C++
Eclipse
Include
Eclipse Cdt
Include Path
What's the difference between sizeof and alignof?
C++
C++11
Sizeof
Alignof
What's the point of a final virtual function?
C++
C++11
Inheritance
Final
Virtual Functions
How to convert errno to exception using <system_error>
C++
Exception
C++11
pop_back() return value?
C++
Vector
Remove reference in decltype (return T instead of T& where T& is the decltype)
C++
Templates
C++11
Type Deduction
Which Boost libraries are header-only?
C++
Boost
using OpenCV and SVM with images
C++
Opencv
Svm
reinterpret_cast between char* and std::uint8_t* - safe?
C++
C++11
Language Lawyer
Strict Aliasing
Uint8t
Can I use ' == ' to compare two vectors. I tried it and seems to be working fine. But I don't know whether it will work in more complex situations
C++
Vector
Operator Overloading
Equality
Redefining lambdas not allowed in C++11, why?
C++
C++11
Lambda
Language Lawyer
Implicit instantiation of undefined template 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >'
C++
Ios
Objective C++
Has C++ standard changed with respect to the use of indeterminate values and undefined behavior in C++14?
C++
C++11
Language Lawyer
Undefined Behavior
C++14
How memset initializes an array of integers by -1?
C++
C
Arrays
Twos Complement
Memset
How to emplace object with no-argument constructor into std::map?
C++
C++11
what does cout << "\n"[a==N]; do?
C++
Cout
String Literals
What does the integer suffix J mean?
C++
C
Integer
Suffix
C vs C++ struct alignment
C++
C
Pointers
Struct
Object Layout
C++ doesn't tell you the size of a dynamic array. But why?
C++
Dynamic Arrays
Convert Keras model to C++
C++
Tensorflow
Theano
Conv Neural-Network
Keras
difference between standard's atomic bool and atomic flag
C++
Multithreading
C++11
Thread Safety
Atomic
When can I use explicit operator bool without a cast?
C++
Implicit Conversion
Adding smallest possible float to a float
C++
C++11
Floating Point
Is there a GCC option to warn about writing `this-field` instead of `this->field`?
C++
Gcc
Gcc Warning
Does this function have explicit return values on all control paths?
C++
Templates
Return
Code Coverage
What does "int* p=+s;" do?
C++
Arrays
Pointers
Unary Operator
Why does double in C print fewer decimal digits than C++?
C++
C
Floating Point
Numbers
Precision
Why is `abs()` implemented differently?
C++
Gcc
Compilation
Clang
Why does std::bit_width return 0 for the value 0, shouldn't it return 1?
C++
C++20
Catching exceptions from a constructor's initializer list
C++
Exception
How do I make a C++ macro behave like a function?
C++
C Preprocessor
Determine the size of a C++ array programmatically?
C++
Arrays
Pointers
Memory Management
Last key in a std::map
C++
Iterator
Stdmap
Why don't C++ compilers define operator== and operator!=?
C++
Operators
getting a normal ptr from shared_ptr?
C++
Boost
Smart Pointers
Shared Ptr
Should a buffer of bytes be signed or unsigned char buffer?
C++
C
Char
Buffer
What does the suffix #DEN mean on the value of a variable
C++
Visual Studio
Debugging
Visual Studio-2005
Exporting classes containing `std::` objects (vector, map etc.) from a DLL
C++
Visual Studio
Dll
How to iterate over a std::map full of strings in C++
C++
Dictionary
Iterator
Std
Stdmap
Can the default destructor be generated as a virtual destructor automatically?
C++
Destructor
Representing 128-bit numbers in C++
C++
Math
Can I use a mask to iterate files in a directory with Boost?
C++
Boost
Filesystems
ifstream: how to tell if specified file doesn't exist
C++
File
Checking if this is null
C++
Pointers
Null
C++ cache aware programming
C++
Optimization
Caching
Cpu Cache
How to write a Java-enum-like class with multiple data fields in C++?
Java
C++
Enums
Does C++ call destructors for global and class static variables?
C++
Global Variables
Destructor
Boost.ASIO-based HTTP client library (like libcurl)
C++
Http
Curl
Boost Asio
Force GCC to notify about undefined references in shared libraries
C++
Shared Libraries
Dynamic Linking
The cost of passing by shared_ptr
C++
Performance
Shared Ptr
How to find whether an element exists in std::map?
C++
Is Google Mock a good mocking framework?
C++
Mocking
Googlemock
What C++11 features does Visual Studio 2010 support?
C++
Visual Studio-2010
Visual Studio
C++11
What does 'unsigned temp:3' in a struct or union mean?
C++
C
Bit Fields
Colon
How does this "size of array" template function work?
C++
Arrays
Templates
Size
Sizeof
Where are C/C++ main function's parameters?
C++
C
Parameters
Location
Main
Find mapped value of map
C++
Dictionary
Find
Stdmap
Aren't Boolean variables always false by default?
C++
Syntax
My enum is not a class or namespace
C++
Enums
G++
C++11
Does true equal to 1 and false equal to 0?
C++
C
Boolean
How to call qDebug without the appended spaces and newline?
C++
Qt
Qdebug
How to create a single instance application in C or C++
C++
C
Linux
Single Instance
How do I initialize a member array with an initializer_list?
C++
Arrays
C++11
Initializer List
When did C++ compilers start considering more than two hex digits in string literal character escapes?
C++
String
Escaping
Literals
Is hash_map part of the STL?
C++
Stl
Hashmap
boost::unique_lock vs boost::lock_guard
C++
Boost
Locking
Do we really need "enum class" in C++11?
C++
Enums
C++11
Language Lawyer
Is D's grammar really context-free?
C++
Grammar
Context Free-Grammar
D
Difference between boost::scoped_ptr<T> and std::unique_ptr<T>
C++
Unique Ptr
Scoped Ptr
How do static variables in lambda function objects work?
C++
C++11
Static
Lambda
What can and can't I specialize in the std namespace?
C++
C++11
Std
Explicit Specialization
design suggestion: llvm multiple runtime contexts
C++
Llvm
Profiling a dynamic pinvoke
C++
Pinvoke
Cil
Clr Profiling-Api
STL vector: Moving all elements of a vector
C++
Stl
Stdvector
What is the difference between a trait and a policy?
C++
Template Meta-Programming
Typetraits
Policy Based-Design
Classification of detectors, extractors and matchers
C++
Image Processing
Opencv
Computer Vision
Feature Detection
Netbeans 7.2 shows "Unable to resolve identifier" , although build is successful
C++
Linux
Netbeans
Netbeans 7
Do you (really) write exception safe code?
C++
Exception Handling
What's the purpose of using braces (i.e. {}) for a single-line if or loop?
C++
C
Coding Style
Curly Braces
Defensive Programming
Is uninitialized local variable the fastest random number generator?
C++
C
Undefined Behavior
Garbage
Detecting superfluous #includes in C/C++?
C++
C
Refactoring
Include
Dependencies
When should I use the new keyword in C++?
C++
Pointers
Reference
New Operator
Keyword
C/C++ include header file order
C++
C
check if a std::vector contains a certain object?
C++
Vector
what is the difference between set and unordered_set in C++?
C++
Algorithm
Data Structures
C++11
Error with multiple definitions of function
C++
Definition
Friend
error: ‘unique_ptr’ is not a member of ‘std’
C++
C++11
G++
Unique Ptr
Do negative numbers return false in C/C++?
C++
C
Boolean
Why does std::move prevent RVO (return value optimization)?
C++
C++11
Move Semantics
Return Value-Optimization
What is the difference between auto and decltype(auto) when returning from a function?
C++
C++14
What is an 'undeclared identifier' error and how do I fix it?
C++
Compiler Errors
Declaration
Undeclared Identifier
Pause Console in C++ program
C++
std::map emplace without copying value
C++
C++11
Dictionary
Stl
Emplace
How is ambiguity determined in the overload resolution algorithm?
C++
Overload Resolution
Why are unsigned integers error prone?
C++
Unsigned Integer
Are new and delete still useful in C++14?
C++
C++11
New Operator
C++14
Dynamic Memory-Allocation
Why does clang's stdbool.h contain #define false false
C++
Clang
Language Lawyer
Compile c++14-code with g++
C++
G++
Ubuntu 14.04
C++14
If two objects are declared in a single line, in which order are they constructed?
C++
Language Lawyer
Declaration
Object Construction
Advantages of using user-defined literal for strings instead of string literal
C++
String
C++14
User Defined-Literals
Visual Studio 2017 errors on standard headers
C++
Visual Studio
Visual Studio-2017
Changed rules for protected constructors in C++17?
C++
Constructor
Language Lawyer
C++17
Protected
GCC can't differentiate between operator++() and operator++(int)
C++
Operator Overloading
Multiple Inheritance
Ambiguous
What's the difference between const array and static const array in C/C++
C++
C
Arrays
Static
Constants
How to force GCC to assume that a floating-point expression is non-negative?
C++
Gcc
Assembly
Floating Point
Micro Optimization
How is numpy so fast?
C++
Arrays
C
Performance
Numpy
C++ unit testing framework
C++
Unit Testing
Python: SWIG vs ctypes
Python
C++
Swig
Ctypes
Ffi
How do I sort a std::vector by the values of a different std::vector?
C++
Stl
Boost
Vector
Sorting
C++ for a C# developer
C++
Using Unicode in C++ source code
C++
Unicode
Character Encoding
Standards
Namespaces in C
C++
C
Namespaces
C Preprocessor
Using an enum as an array index
C++
Enums
How to emit cross-thread signal in Qt?
C++
Qt
Signals Slots
Qt Signals
Convert iterator to pointer?
C++
Stl
Pointers
Vector
Iterator
Differences between Conditional variables, Mutexes and Locks
C++
Multithreading
C++11
Mutex
Condition Variable
Why do round() and ceil() not return an integer?
C++
C
Casting
Rounding
How to set application icon in a Qt-based project?
C++
Qt
Visual C++ equivalent of GCC's __attribute__ ((__packed__))
C++
C
Visual C++
Gcc
Data Structures
Template static variable
C++
Templates
Static
What is the maximum length in chars needed to represent any double value?
C++
C
Floating Point
Passing a string literal as a type argument to a class template
C++
Templates
Can I convert a reverse iterator to a forward iterator?
C++
Iterator
Why should I always enable compiler warnings?
C++
C
Warnings
Compiler Warnings
C++ Faq
Is it safe to delete a NULL pointer?
C++
Pointers
Memory Management
Null Pointer
Delete Operator
Size of character ('a') in C/C++
C++
C
Types
Difference between shared objects (.so), static libraries (.a), and DLL's (.so)?
C++
C
Linux
Dll
Linker
Converting from a std::string to bool
C++
String
Boolean
Can I use const in vectors to allow adding elements, but not modifications to the already added?
C++
Stl
Constants
Any utility to test expand C/C++ #define macros?
C++
Macros
C Preprocessor
Console output in a Qt GUI app?
C++
Windows
Qt
Qt4
std::vector needs to have dll-interface to be used by clients of class 'X<T> warning
C++
Dll
Learning C++: polymorphism and slicing
C++
Polymorphism
How to access a local variable from a different function using pointers?
C++
C
Pointers
Local Variables
double or float, which is faster?
C++
Floating Point
Double
Avoiding Circular Dependencies of header files
C++
Software Design
Architecture
Purpose of a ".f" appended to a number?
C++
Syntax
Casting
Is it safe to use the "this" pointer in an initialization list?
C++
Initialization
This
Passing as const and by reference - Worth it?
C++
The copy constructor and assignment operator
C++
Constructor
Operators
Copy Constructor
Assignment Operator
Convert a double to a QString
C++
Qt
Get current cursor position
C++
Winapi
Optimizations for pow() with const non-integer exponent?
C++
Math
Optimization
Avx
Exponent
Are abstract methods and pure virtual functions the same thing?
C++
Function
Virtual
Checking if a variable is initialized
C++
Class
Are there any concurrent containers in C++11?
C++
Visual Studio-2010
Concurrency
C++11
Blockingqueue
Iterating over a QMap with for
C++
Qt
C++11
Qmap
Disabling g++'s return-value optimisation
C++
Optimization
Compiler Construction
G++
Return Value-Optimization
C++ signal to QML slot in Qt
C++
Qt
Qml
Signals Slots
how to check if given c++ string or char* contains only digits?
C++
String
Pattern Matching
get absolute value without using abs function nor if statement
C++
C
Bit Manipulation
Is it possible to create a function dynamically, during runtime in C++?
C++
Function
Dynamic
Runtime
Do we have closures in C++?
C++
Closures
Lexical Closures
Are "anonymous structs" standard? And, really, what *are* they?
C++
Does [=] imply that all local variables will be copied?
C++
C++11
Lambda
Capture
C++ calling base class constructors
C++
Object
Inheritance
Are int8_t and uint8_t intended to be char types?
C++
C++11
Iostream
Language Lawyer
Standard Library
Infinite loop in constructor without for or while
C++
Recursion
Constructor
Constants
C++ JSON Serialization
C++
Json
Default template parameter partial specialization
C++
Templates
Specialization
Default Parameters
What is the use of "using namespace std"?
C++
Namespaces
Std
Using
Difference between priority queue and a heap
C++
Algorithm
Heap
Priority Queue
Is it good practice to use std::vector as a simple buffer?
C++
Std
Stdvector
How to properly add include directories with CMake
C++
Ubuntu
Cmake
Find out if string ends with another string in C++
C++
String
Ends With
linker error while linking boost log tutorial (undefined references)
C++
Boost
Fedora
Ld
Test a specific exception type is thrown AND the exception has the right properties
C++
Unit Testing
Exception
Googletest
How can Boost be used to achieve C++14-style auto return types?
C++
C++11
Boost
Why does auto x{3} deduce an initializer_list?
C++
C++11
Auto
Initializer List
Type Deduction
Convert Mat to Array/Vector in OpenCV
C++
Arrays
Opencv
Vector
Synthesis
Efficiently getting all divisors of a given number
C++
Algorithm
Math
Factorization
What is the actual use of "signed" keyword?
C++
Is x = std::move(x) undefined?
C++
C++11
Language Lawyer
C++14
Why does the C preprocessor consider enum values as equal?
C++
C Preprocessor
Why do C++ optimizers have problems with these temporary variables or rather why `v[]` should be avoided in tight loops?
C++
Performance
Optimization
Is unevaluated division by 0 undefined behavior?
C++
C
Language Lawyer
Are functors actually faster than pointers to functions?
C++
Function Pointers
Function Object
Inlining
Equivalent ternary operator for constexpr if?
C++
Constexpr
C++17
If Constexpr
GCC 7, -Wimplicit-fallthrough warnings, and portable way to clear them?
C++
Gcc
Switch Statement
Warnings
Why has std::reduce been added in C++17?
C++
Std
C++17
What does the gcc warning "project parameter passing for X changed in GCC 7.1" mean?
C++
Gcc
Are nested structured bindings possible?
C++
C++17
Structured Bindings
Class static variable initialization order
C++
Scope
Language Lawyer
Why does C++11 contain an odd clause about comparing void pointers?
C++
C++11
Pointers
Language Lawyer
Comparison Operators
What are the similarities and differences between C++'s concepts and Rust's traits?
C++
Rust
Traits
C++ Concepts
Is there a nice way to assign std::minmax(a, b) to std::tie(a, b)?
C++
Algorithm
Reference
Stl
C++17
Why did the range based 'for' loop specification change in C++17?
C++
For Loop
Language Lawyer
C++17
Forgot do in do... while loop
C++
How to get memory usage under Windows in C++
C++
Windows
Memory Management
Initializing a union with a non-trivial constructor
C++
Constructor
Multiplatform
Compilers and argument order of evaluation in C++
C++
Operator Precedence
How to run a bash script from C++ program
C++
Linux
Bash
Shell
What do I get from front() of empty std container?
C++
Stl
Create WCF service for unmanaged C++ clients
C++
Wcf
Web Services
Soap
Wsdl
C++ STL map::erase a non-existing key
C++
Stl
Map
Key
Erase
Difference between erase and remove
C++
Stl
C++ custom stream manipulator that changes next item on stream
C++
Stream
Using a C++ class member function as a C callback function
C++
C
Interop
Callback
Get list of static libraries used in an executable
C++
C
Unix
Static
Linker
Are function static variables thread-safe in GCC?
C++
Gcc
Static
Initialization
Thread Safety
How can I iterate through a string and also know the index (current position)?
C++
String
Iterator
Reading a password from std::cin
C++
Stl
Password Protection
How is std::string implemented?
C++
String
Std
Cstring
What is the right approach when using STL container for median calculation?
C++
Algorithm
Stl
Containers
Median
C++ logging framework suggestions
C++
Logging
C++ implicit copy constructor for a class that contains other objects
C++
Contains
Composition
Default Copy-Constructor
Difference between pointer to a reference and reference to a pointer
C++
Memory
Pointers
Reference
C++ [] array operator with multiple arguments?
C++
Arrays
Operators
Operator Keyword
How to avoid code duplication implementing const and non-const iterators?
C++
Iterator
Constants
Dry
cannot open shared object file: No such file or directory
C++
Removing a non empty directory programmatically in C or C++
C++
C
Avoid warning 'Unreferenced Formal Parameter'
C++
Compiler Warnings
Suppress Warnings
Is there a way to do a #define inside of another #define?
C++
C Preprocessor
Adding message to assert
C++
Logging
Debugging
Assert
Comparison of C++ unit test frameworks
C++
Unit Testing
Cppunit
Googletest
Boost Test
How do you make a HTTP request with C++?
C++
Httprequest
How to make a SIMPLE C++ Makefile
C++
Makefile
Should we pass a shared_ptr by reference or by value?
C++
C++11
Boost
Shared Ptr
Where to put default parameter value in C++?
C++
Default Arguments
Copy a file in a sane, safe and efficient way
C++
File Io
QComboBox - set selected item based on the item's data
C++
Qt
User Interface
Combobox
Qcombobox
How to search for an element in an stl list?
C++
Stl
How to assign a C struct inline?
C++
C
Struct
What's the syntax for declaring an array of function pointers without using a separate typedef?
C++
Arrays
Syntax
Function Pointers
Typedef
What if I write return statement in constructor?
C++
Constructor
Return Value
Return
Return Type
how portable is end iterator decrement?
C++
Stl
Iterator
Portability
increment map<string, int> using ++ operator
C++
Map
Operators
OpenMP: are local variables automatically private?
C++
C
Parallel Processing
Openmp
Why use functors over functions?
C++
Stl
Functor
Why is "!=" used with iterators instead of "<"?
C++
Stl
Iterator
Comparison Operators
Weird use of `?:` in `typeid` code
C++
Conditional Operator
Micro Optimization
Typeid
How to break when a specific exception type is thrown in GDB?
C++
Gdb
What is happening here in this C++ code?
C++
Get an istream from a char*
C++
Istream
What are top-level const qualifiers?
C++
Constants
c++ header files including each other mutually
C++
Header
Include
Iterative DFS vs Recursive DFS and different elements order
C++
Algorithm
Graph
Depth First-Search
Traversal
Difference between <string> and <string.h>?
C++
String
Header
Header Files
Preferred standard use: range based for or std::for_each
C++
Coding Style
C++11
Copy an cv::Mat inside a ROI of another one
C++
Opencv
Copy
Roi
Does new char actually guarantee aligned memory for a class type?
C++
C++11
Language Lawyer
Installing OpenCV 2.4.3 in Visual C++ 2010 Express
C++
Visual C++
Opencv
std::this_thread::yield() vs std::this_thread::sleep_for()
C++
Multithreading
C++11
How to get list of files with a specific extension in a given folder?
C++
Filesystems
File Management
Initializing strings as null vs empty string
C++
String
Initialization
How to pretty-print STL containers in GDB?
C++
Linux
Debugging
Stl
Gdb
Correct way to initialize vector member variable
C++
Comparing STL strings that use different allocators
C++
String
Memory Management
Stl
How to compile and execute from memory directly?
C++
Linux
Why not non-const reference to temporary objects?
C++
Temporary Objects
Should I include <xxxx.h> or <cxxxx> in C++ programs?
C++
Include
C++ Faq
remove unique_ptr from queue
C++
C++11
Unique Ptr
The precision of std::to_string(double)
C++
C++11
How to construct a std::string from a std::vector<string>?
C++
Stl
String Concatenation
Stringstream
Stdstring
how do you insert the value in a sorted vector?
C++
Sorting
Vector
Stl
Insertion Sort
How and when should I use pitched pointer with the cuda API?
C++
Cuda
why do I need std::condition_variable?
C++
C++11
Concurrency
Should custom containers have free begin/end functions?
C++
C++11
Iterator
Containers
Argument Dependent-Lookup
Writing Universal memoization function in C++11
C++
C++11
Memoization
Select class constructor using enable_if
C++
Templates
Constructor
Sfinae
Make QLabel text selectable?
C++
Qt
Refreshing the auto complete (IntelliSense) database in Visual Studio
C++
Windows
Visual Studio-2010
Visual Studio-2008
Camera position in world coordinate from cv::solvePnP
C++
Opengl
Opencv
Computer Vision
Pose Estimation
Does `sizeof` *really* evaluate to a `std::size_t`? Can it?
C++
C++11
Std
Language Lawyer
Do the &= and |= operators for bool short-circuit?
C++
Boolean
Lazy Evaluation
Short Circuiting
Compound Assignment
How to use the Qt's PIMPL idiom?
C++
Qt
Pimpl Idiom
CMake: target_include_directories() prints an error when I try to add the source directory itself, or one of its subdirectories
C++
Cmake
Header Only
How to create a C project with CLion
C++
C
Cmake
Clion
How to detect reliably Mac OS X, iOS, Linux, Windows in C preprocessor?
C++
C
Cross Platform
C Preprocessor
Os Detection
What is the difference between private and protected members of C++ classes?
C++
Class
Oop
Private
Protected
convert a char* to std::string
C++
Stdstring
How can I emulate destructuring in C++?
C++
C++17
Destructuring
Language Construct
Cmake cannot find library using "link_directories"
C++
Cmake
Makefile
Removing watermark out of an image using OpenCV
C++
Opencv
Image Processing
Watermark
Why is there not an std::is_struct type trait?
C++
C++11
Typetraits
What is the advantage of commas in a conditional statement?
C++
If Statement
Comma
specify default value of std::function
C++
Lambda
C++11 auto declaration with and without pointer declarator
C++
C++11
Auto
Variable Declaration
Do C++ enums Start at 0?
C++
Enums
Language Lawyer
Enumeration
Ordinal
Are C/C++ fundamental types atomic?
C++
C
Multithreading
Atomic
Why does using a temporary object in the range-based for initializer result in a crash?
C++
C++11
Why does the number of elements in a initializer list cause an ambiguous call error?
C++
Initializer List
Ambiguous
Overload Resolution
Why don't compilers merge redundant std::atomic writes?
C++
Multithreading
C++11
Compiler Optimization
Stdatomic
Why is const required for 'operator>' but not for 'operator<'?
C++
Sorting
Operator Overloading
Why is `const T&` not sure to be const?
C++
Templates
Constants
Function Templates
Const Reference
How do I organize members in a struct to waste the least space on alignment?
C++
Optimization
Memory Alignment
Memory Layout
Struct Member-Alignment
GNU compiler warning "class has virtual functions but non-virtual destructor"
C++
Gcc
Is 'bool' a basic datatype in C++?
C++
variable or field declared void
C++
String
Void
Headers Including Each Other in C++
C++
Recursion
Header
Include
Overriding public virtual functions with private functions in C++
C++
Overriding
Access Control
Virtual Functions
C++ virtual function from constructor
C++
Oop
Class
Constructor
Virtual
Platform-independent GUID generation in C++?
C++
Cross Platform
Guid
Uuid
Has anyone ever had a use for the __COUNTER__ pre-processor macro?
C++
C
what is "stack alignment"?
C++
Data Structures
Mingw
Visual C++
Compiler Construction
Is there a good Python library that can parse C++?
C++
Python
Template issue causes linker error (C++)
C++
Templates
Compiler Errors
warning C4003 and errors C2589 and C2059 on: x = std::numeric_limits<int>::max();
C++
Visual C++
Max
Numeric Limits
How to raise warning if return value is disregarded?
C++
C
Gcc
Static Analysis
What is the difference between a concrete class and an abstract class?
C++
Oop
Class
What is the most efficient way to append one std::vector to the end of another?
C++
Performance
Stl
Vector
constant variables not working in header
C++
C
Visual Studio
Visual Studio-2008
Visual C++
What does "WINAPI" in main function mean?
C++
C
Windows
Winapi
Winmain
Deep copy vs Shallow Copy
C++
Clone
Use of for_each on map elements
C++
Algorithm
Stl
Stdmap
Std Pair
How can I take a screenshot in a windows application?
C++
Winapi
Screenshot
Initializing std::tuple from initializer list
C++
C++11
Visual Studio 2010 not autolinking static libraries from projects that are dependencies as it should be supposed to
C++
Visual Studio
Visual Studio-2010
Build
Checking if a directory exists in Unix (system call)
C++
C
Unix
Directory
Exists
What is the meaning of "generic programming" in c++?
C++
best way to return an std::string that local to a function
C++
Return Value
Understanding boost::disjoint_sets
C++
Boost
Disjoint Sets
What does the symbol \0 mean in a string-literal?
C++
C
String
Escaping
String Literals
C++ - char** argv vs. char* argv[]
C++
Main
Arguments
How does C++ handle &&? (Short-circuit evaluation)
C++
Short Circuiting
And Operator
Logical And
How does a sentinel node offer benefits over NULL?
C++
Algorithm
Data Structures
How do I build a graphical user interface in C++?
C++
User Interface
Throwing exceptions from constructors
C++
Exception
Constructor
Throw
The proper way of forcing a 32-bit compile using CMake
C++
Gcc
Cmake
32bit 64bit
Ld
How to find and replace string?
C++
String
Is memory allocation a system call?
C++
C
Operating System
Heap Memory
How do files get into the External Dependencies in Visual Studio C++?
C++
Visual Studio
Visual C++
External Dependencies
if (cin >> x) - Why can you use that condition?
C++
Variables
If Statement
Cin
Format specifiers for uint8_t, uint16_t, ...?
C++
C++11
Scanf
What does `std::kill_dependency` do, and why would I want to use it?
C++
Multithreading
Memory Model
C++11
c++11 foreach syntax and custom iterator
C++
Iterator
C++11
Executing cv::warpPerspective for a fake deskewing on a set of cv::Point
C++
Opencv
Image Processing
Perspective
Skew
Are destructors called after a throw in C++?
C++
Exception Handling
Try Catch
Raii
How to cin values into a vector
C++
Function
Templates
Vector
Cin
how does malloc understand alignment?
C++
C
Memory Alignment
Using C++ Boost's Graph Library
C++
Boost
With explicitly deleted member functions in C++11, is it still worthwhile to inherit from a noncopyable base class?
C++
C++11
Noncopyable
Deprecated conversion from string literal to 'char*'
C++
String
Char
Deprecated
Literals
C++ variable has initializer but incomplete type?
C++
Class
Compiler Construction
Vectors in Arduino
C++
Vector
Arduino
C++ create string of text and variables
C++
String
Variables
Std
How do I print vector values of type glm::vec3 that have been passed by reference?
C++
Glm Math
Comparing arrays for equality in C++
C++
Arrays
Comparison
Equality
Detailed guide on using gcov with CMake/CDash?
C++
Testing
Cmake
Code Coverage
Cdash
How to call a C# library from Native C++ (using C++\CLI and IJW)
C#
C++
Visual Studio-2010
C# 4.0
C++ Cli
Can you have a triple minus signs in C programming? What does it mean?
C++
C
cpp / c++ get pointer value or depointerize pointer
C++
Pointers
What is a converting constructor in C++ ? What is it for?
C++
Constructor
Copy Constructor
Penalty of the MSVS compiler flag /bigobj
C++
Visual Studio
Linker Errors
Splitting protocol buffer definitions into multiple .proto files
C++
Protocol Buffers
C++ Threads, std::system_error - operation not permitted?
C++
Multithreading
C++11
Std System-Error
Is it possible to build Boost with CMake?
C++
Boost
Cmake
Why is this an undefined behavior?
C++
C
Undefined Behavior
error: member access into incomplete type : forward declaration of
C++
Forward Declaration
Simple illumination correction in images OpenCV C++
C++
Opencv
Image Processing
Contrast
When is a const reference better than pass-by-value in C++11?
C++
C++11
"" + something in C++
C++
String
In clang-format, what do the penalties do?
C++
Clang Format
std::unique_ptr for C functions that need free
C++
C++11
C++, do private functions really need to be in the header file?
C++
Standards
Conventions
Why can't constructors deduce template arguments?
C++
Is there a way to pass auto as an argument in C++?
C++
Function
Arguments
Auto
Playing a custom avi data stream using QtMultimedia
C++
Qt
Ffmpeg
Qtmultimedia
Branchless K-means (or other optimizations)
C++
Performance
Optimization
Can we have functions inside functions in C++?
C++
Printing 1 to 1000 without loop or conditionals
C++
C
Printf
Returning multiple values from a C++ function
C++
Fast ceiling of an integer division in C / C++
C++
C
Algorithm
Math
C++ switch statement expression evaluation guarantee
C++
Standards
Language Lawyer
C++: Unresolved external symbol _sprintf and _sscanf in Visual Studio 2015
C++
Visual Studio-2015
Visual Studio /**/ comment shortcut?
C#
C++
Visual Studio
Keyboard Shortcuts
Comments
When I should use std::map::at to retrieve map element
C++
C++11
Stdmap
Why does `int ;` compile fine in C, but not in C++?
C++
C
Gcc
Language Lawyer
Variable Declaration
Fast way to generate pseudo-random bits with a given probability of 0 or 1 for each bit
C++
C
Algorithm
Random
Bit Manipulation
Can a C++ default argument be initialized with another argument?
C++
Difference between func() and (*this).func() in C++
C++
Dispatch
what does this ... (three dots) means in c++
C++
How to call machine code stored in char array?
C++
C
Linux
Native
Machine Code
Initialize all the elements of an array to the same number
C++
Arrays
For Loop
Why do compilers duplicate some instructions?
C++
Compiler Construction
Clang
How is the three-way comparison operator different from subtraction?
C++
Comparison Operators
C++20
Spaceship Operator
Why don't C++ compilers do better constant folding?
C++
Compiler Construction
Eigen
Automatic Differentiation
Ceres Solver
How can I make a variable always equal to the result of some calculations?
C++
C++11
How to install (v142) Build tools in Visual studio
C++
Visual Studio
Visual Studio-2017
Signed overflow in C++ and undefined behaviour (UB)
C++
Undefined Behavior
Should I use nested classes in this case?
C++
Oop
Class
Nested Class
How can I get the IP Address of a local computer?
C++
Sockets
Networking
Portability of #warning preprocessor directive
C++
Compiler Construction
Warnings
C Preprocessor
Portability
What is the best encryption library in C/C++?
C++
C
Encryption
Why destructor is not called on exception?
C++
Exception
Visual C++
Destructor
Stack Unwinding
What are some reasons a Release build would run differently than a Debug build
C++
Visual Studio
Visual Studio-2005
Destruction order of static objects in C++
C++
Static
Destruction
Does a Java to C++ converter/tool exist?
Java
C++
Code Translation
Difference between void main and int main in C/C++?
C++
C
Function
Standards
Main
What is the order in which the destructors and the constructors are called in C++
C++
Constructor
Destructor
Convert CString to const char*
C++
Visual Studio
Visual C++
Unicode
Mfc
Javadoc-like Documentation for C++
Java
C++
Javadoc
What does a colon in a struct declaration mean, such as :1, :7, :16, or :32?
C++
C
Bit Fields
Why isn't C/C++'s "#pragma once" an ISO standard?
C++
C
Pragma
Include Guards
Can I set a default argument from a previous argument?
C++
Function
Arguments
Theory on error handling?
C++
Error Handling
C++, is it possible to call a constructor directly, without new?
C++
Constructor
Placement New
Using ASSERT and EXPECT in GoogleTest
C++
Unit Testing
Googletest
Why pass by const reference instead of by value?
C++
Function
What is the default value for C++ class members
C++
Class
Struct
Default Value
Writing BMP image in pure c/c++ without other libraries
C++
C
Image
Graphics
Bmp
How can I decode the boost library naming?
C++
Boost
Boost Build
Bjam
Could I ever want to access the address zero?
C++
C
Memory
Pointers
C++0x thread interruption
C++
Multithreading
C++11
How to "Reveal in Finder" or "Show in Explorer" with Qt
C++
Qt
Qt4
How to parse date/time from string?
C++
Datetime
Boost
Utc
Boost Date-Time
How do I programmatically get the free disk space for a directory in Linux
C++
Linux
Move constructor on derived object
C++
C++11
Move Semantics
++i or i++ in for loops ??
C++
For Loop
Post Increment
Pre Increment
How to use the boost library (including shared_ptr) with the Android NDK and STLport
C++
Boost
Android Ndk
Stlport
How to define sealed class in C++?
C++
Class
Inheritance
Derived Class
Sealed
Why is my power operator (^) not working?
C++
C
How do I iterate over a Constant Vector?
C++
Visual C++
How to reverse an std::string?
C++
String
Binary
Reverse
Are there types bigger than long long int in C++?
C++
Types
What is the purpose of std::launder?
C++
Memory
C++17
C++ Faq
Stdlaunder
Why would someone use #define to define constants?
C++
Constants
C Preprocessor
How to check whether operator== exists?
C++
Sfinae
When do we need a private constructor in C++?
C++
Constructor
Private
smart pointers and arrays
C++
C++11
Smart Pointers
Automatically pick a variable type big enough to hold a specified number
C++
Templates
Template Meta-Programming
Defining an object without calling its constructor in C++
C++
Class
Object
Constructor
Is this C++11 regex error me or the compiler?
C++
Regex
Gcc
C++11
C++11: Replace all non-owning raw pointers with std::shared_ptr()?
C++
Memory
C++11
Smart Pointers
Why are anonymous namespaces not a sufficient replacement for namespace-static, according to the standards committee?
C++
C++11
How can I store a lambda expression as a field of a class in C++11?
C++
Class
Lambda
C++11
Field
Evaluating arithmetic expressions from string in C++
C++
C++11 does not deduce type when std::function or lambda functions are involved
C++
Templates
Lambda
C++11
Single, double quotes and sizeof('a') in C/C++
C++
C
Gcc
Getting filename (or path) from fstream
C++
File Io
Fstream
Using std::move() when returning a value from a function to avoid to copy
C++
static const vs. const static
C++
Class
Constants
openCV program compile error "libopencv_core.so.2.4: cannot open shared object file: No such file or directory" in ubuntu 12.04
C++
Ubuntu
Opencv
G++
Making std::vector allocate aligned memory
C++
Memory Management
Memory Alignment
Allocator
What exactly is the L prefix in C++?
C++
String
Widestring
How does OpenMP handle nested loops?
C++
Loops
Parallel Processing
Openmp
Concise explanation of reference collapsing rules requested: (1) A& & -> A& , (2) A& && -> A& , (3) A&& & -> A& , and (4) A&& && -> A&&
C++
Stl
how to do static linking of libwinpthread-1.dll in mingw?
C++
Mingw
Static Linking
Is std::vector memory freed upon a clear?
C++
Optimization
Memory
Vector
std::shared_ptr thread safety
C++
Std
Shared Ptr
How to create timer events using C++ 11?
C++
C++11
How can I use a C++11 to program the Arduino?
C++
Ide
Arduino
Firmware
Random Engine Differences
C++
Random
C++11
How to find a value in a sorted C++ vector in the most efficient way?
C++
Sorting
Search
Vector
Find
Qt Slots and C++11 lambda
C++
Qt
C++11
Type safe physics operations in C++
C++
C++11
Type Safety
Different results between gcc and clang when compiling a rather simple c++11 program
C++
Gcc
C++11
Clang
Performance Tradeoff - When is MATLAB better/slower than C/C++
C++
C
Performance
Matlab
Why does the order of template argument substitution matter?
C++
Templates
C++11
Language Lawyer
C++14
undefined reference to 'vtable for class' constructor
C++
Class
Constructor
What changes introduced in C++14 can potentially break a program written in C++11?
C++
C++11
C++14
Language Lawyer
C++ Faq
Check if element is in the list (contains)
C++
Contains
What is IACA and how do I use it?
C++
C
Performance
Assembly
Iaca
Does a declaration using "auto" match an extern declaration that uses a concrete type specifier?
C++
Language Lawyer
Extern
Auto
Why is there a significant difference in this C++ for loop's execution time?
C++
Performance
Nested Loops
Is ++x %= 10 well-defined in C++?
C++
Language Lawyer
Undefined Behavior
Evaluation
What is the difference between .o, .a, and .so files?
C++
C
Shared Libraries
Static Libraries
Unknown compiler version while compiling Boost with MSVC 14.0 (VS 2015)
C++
Boost
Visual Studio-2015
std::shared_ptr: reset() vs. assignment
C++
C++11
Shared Ptr