Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
3 votes
3 answers
199 views

I want to pass a C-style array to a function taking a std::span, but overload resolution chooses to convert the array to bool instead. Is this behavior required by the standard, or is it a compiler ...
prl's user avatar
  • 12.5k
3 votes
1 answer
168 views

Here's a very basic program I wrote to test how Java overloading is resolved when an exact match is not found, and what priority is assigned to other matching methods. import java.io.*; public class ...
1 vote
1 answer
137 views

(I was making an integer class to replace C's stuff, then this hit me. I wanted an overload for pointer arithmetic.) MSVC and GCC pass without errors or warnings. Compilation: g++ -std=c++2c -fsyntax-...
16 votes
1 answer
717 views

After seeing this post: If a class has a destructor declared with a requires clause that evaluates to false, why is the class not trivially destructible? I have a separate question, and I haven't ...
1 vote
1 answer
149 views

Consider the following example: #include <iostream> #include <vector> template<typename T> void foo( T && ) { std::cout << "Common foo!\n"; } template&...
0 votes
0 answers
60 views

I have a problem with an attempt at factorizing two utility functions, each calling a given "hardcoded" function, into one utility with a functor call instead. Meaning I have a factoring ...
6 votes
3 answers
160 views

Consider the following code (live example): #include <memory> struct Base {}; struct Middle : public Base {}; struct Derived : public Middle {}; void foo(Base*); void foo(Middle*); void ...
6 votes
1 answer
164 views

This is a follow-up of this question: `requires` expressions and function namespaces Trying to design an answer I stumbled on this strange behavior: #include <cstdio> // dummy default ...
5 votes
1 answer
211 views

I have a working program that compiles successfully in Visual Studio. But trying to port it to GCC/Clang resulted in some compilation errors. Maximally reduced example is as follows: #include <...
2 votes
1 answer
130 views

There appears to be a discrepancy in how templated function overloads are resolved and how non-templated function overloads are resolved, but there seem to be some cases where it should not make a ...
4 votes
2 answers
104 views

Why is method(new ExtendsRaw()) ambiguous in the code below? public class Main { private Main() {} static class Generic<T> {} @SuppressWarnings("rawtypes") static ...
1 vote
0 answers
73 views

Objective I'm attempting to wrap a variadic function so I can provide an arbitrary set of arguments now and provide the rest later. Ultimately, I want to be able to do something like this: template<...
1 vote
1 answer
77 views

I'm am testing out the C#/Win32 project so I can call Win32 Setup API functions with automatically generated PInvoke wrappers. I am unable to make my code call the correct overload of one of the ...
3 votes
1 answer
159 views

can anyone explain why both cases print "plain int"? #include <iostream> void f(const int (&)[2]) {std::cout<<"int array"<<std::endl;} void f(const int&...
Ship's user avatar
  • 31
4 votes
1 answer
79 views

Ok this might be a bit difficult to explain: I want to call a function hello that has an overload for either an rvalue or an lvalue ref of type Json. This Json object is converted from a JsonKey using ...

15 30 50 per page
1
2 3 4 5
...
54

AltStyle によって変換されたページ (->オリジナル) /