Which headers in the C++ standard library are guaranteed to include another header?

This answer ignores C headers – both the <meow.h> and <cmeow> ones. Of the C++ library headers (all references are to N4659): <initializer_list> is guaranteed to be included by: <utility> (§23.2.1 [utility.syn]) <string> (§24.3.1 [string.syn]) <array> (§26.3.2 [array.syn]) <deque> (§26.3.3 [deque.syn]) <forward_list> (§26.3.4 [forward_list.syn]) <list> (§26.3.5 [list.syn]) <vector> (§26.3.6 [vector.syn]) <map> (§26.4.2 [associative.map.syn]) <set> (§26.4.3 … Read more

How to use C code in C++

Yes, you can include C headers in C++ code. It’s normal to add this: #ifdef __cplusplus extern “C” { #endif // C header here #ifdef __cplusplus } #endif so that the C++ compiler knows that function declarations etc. should be treated as C and not C++.

How to have CMake show headers-that are not part of any binary target-in the IDE?

Several months down the line, I did not find a way to directly list the header files for an INTERFACE library. Since the question still has some views, here is what I ended up doing (i.e. what appears like the lesser hack currently available). Imagine module A is a header only library. In the CMakeLists.txt … Read more

Difference between cuda.h, cuda_runtime.h, cuda_runtime_api.h

In very broad terms: cuda.h defines the public host functions and types for the CUDA driver API. cuda_runtime_api.h defines the public host functions and types for the CUDA runtime API cuda_runtime.h defines everything cuda_runtime_api.h does, as well as built-in type definitions and function overlays for the CUDA language extensions and device intrinsic functions. If you … Read more

List of standard header files in C and C++

The header ‘tree.h’ is not standard anywhere. C Standards ISO/IEC 9899:1990 (C89, C90) The 15 standard headers in C89 are: <assert.h> <limits.h> <signal.h> <stdlib.h> <ctype.h> <locale.h> <stdarg.h> <string.h> <errno.h> <math.h> <stddef.h> <time.h> <float.h> <setjmp.h> <stdio.h> ISO/IEC 9899:1990/Amd.1:1995 The 3 extra headers introduced in C94* (Amendment 1) are: <iso646.h> <wchar.h> <wctype.h> ISO/IEC 9899:1999 (C99) The 6 … Read more

Is the backslash acceptable in C and C++ #include directives?

C99 says (§6.4.7/3): If the characters ‘, \, “, //, or /* occur in the sequence between the < and > delimiters, the behavior is undefined. Similarly, if the characters ‘, \, //, or /* occur in the sequence between the ” delimiters, the behavior is undefined. (footnote: Thus, sequences of characters that resemble escape … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)