compiler-specific Questions
2
Solved
About a year or two ago I read about SFINAE rules in C++. They state, in particular,
The following type errors are SFINAE errors:
...
attempting to create an array of void, array of reference, arr...
Willywillynilly asked 20/9, 2023 at 11:15
1
Solved
The following code can be compiled with gcc-13 and clang-16, but MSVC reports multiple errors
using foo_type = void ((((int, const char*)))); // (1)
// Compiler messages for line (1):
// clang-16: ...
Confetti asked 15/8, 2023 at 4:41
1
Here is the simple example:
#include <type_traits>
#include <ranges>
#include <vector>
struct MyClass
{
void f( int ) {}
void f( char ) {}
template <std::ranges::input_ran...
Gull asked 2/8, 2023 at 13:29
3
Solved
I want to split a string by a token with std::views::split, and for each retrieved substring invoke the std::from_chars function.
Here is an MRE (https://godbolt.org/z/1K71qo9s4) that compiles succ...
Glendaglenden asked 26/7, 2023 at 10:36
2
Solved
I'm using the following program:
In the main function, I want to print the address of the poll_timer function.
The program compiles and runs successfully with clang but not with GCC.
I get the foll...
Hypertonic asked 24/5, 2023 at 17:54
1
I have the following code:
#include <iostream>
#include <vector>
struct C {
int a;
C() : a(0) {}
C(int a) : a(a) {}
};
std::ostream &operator<<(std::ostream &os, con...
Matriculation asked 14/4, 2023 at 9:35
1
Solved
My scenario is the following (it worked in clang but not in gcc)
liba.hpp:
inline int MY_GLOBAL = 0;
libother.cpp: (dll)
#include "myliba.hpp"
void myFunc() {
//
MYGLOBAL = 28;
}
someexe....
Anion asked 5/12, 2019 at 12:50
1
Solved
The TypeScript's docs comes with Compiler Options, where the --strictFunctionTypes is defined with its description. Unfortunately, can't get what is bivariant parameter. I tried to understand https...
Trek asked 14/8, 2019 at 17:31
1
Solved
I have the following piece of C++17 code that uses class template deduction:
template <typename T>
struct Test {
T t;
Test(T t) : t(t) {}
bool check() { return true; }
};
template ...
Eloisaeloise asked 22/11, 2018 at 16:59
2
Solved
In section 20 of Scott Meyer's Effective C++, he states:
some compilers refuse to put objects consisting of only a double into a register
When passing built-in types by value, compilers will h...
Capacious asked 30/8, 2018 at 23:37
1
Solved
My understanding is that in C++17, the following snippet is intended to Do The Right Thing:
struct Instrument; // instrumented (non-trivial) move and copy operations
struct Base {
Instrument i;
}...
Wholesale asked 11/2, 2018 at 2:47
1
Solved
From the the Haskell 98 report:
There is no upper bound on the size of a tuple, but some Haskell implementations may restrict the size of tuples, and limit the instances associated with larger t...
Michelson asked 25/9, 2017 at 19:31
2
Solved
How do I check for presence of individual C++0x/C++11 language features? I know Clang has a nice system for this. What about GCC, Visual Studio or Boost? I guess one way to do it is to detect the c...
Classics asked 19/4, 2012 at 9:42
10
Solved
Taken from http://www.ocf.berkeley.edu/~wwu/riddles/cs.shtml
It looks very compiler specific to me. Don't know where to look for?
Subsidence asked 10/1, 2010 at 19:14
2
Solved
Or, are there any other known negative affects of employing __declspec(novtable)? I can't seem to find references to any issues.
Conan asked 26/11, 2009 at 2:33
1
© 2022 - 2024 — McMap. All rights reserved.