1,313 questions
1 vote
2 answers
149 views
Different handling of signed value between MSVC and GCC
Take the below piece of code, that simply Trims a string, removing whitespace characters from either end: const std::string TrimString(const std::string& s) { const auto iter = std::find_if(s....
-5 votes
1 answer
145 views
Why is auto becoming an int type in the following code: [duplicate]
How is the sum of three doubles not a double?! int main() { auto answer = 1.0 + 2.0 + 3.0; std::cout << answer; return 0; } output: 6 What?!
1 vote
1 answer
105 views
Why doesn’t "auto" change the width and height of my image?
I tried to add a picture to my HTML page, but the image was always way too large. I didn’t want to set the width and height in pixels, because then it doesn’t scale properly when the browser isn’t in ...
-3 votes
1 answer
238 views
Why can't the compiler deduce the element type of `std::vector`?
I want to use auto more in my code and came up with the following example: #include <vector> int main() { auto v{std::vector{}}; for (auto i{0}; i < 10; i++) { v.push_back(i)...
3 votes
3 answers
228 views
Receiving a lambda through auto&&
If I assign a lambda in C++ with this: auto&& mylambda = [&](int someparam) { some_function(); return 42; }; Is this wrong? I know that this triggers auto type deduction, but is ...
2 votes
1 answer
199 views
"function with deduced return type cannot be used before it is defined" when using template <> specialization
I'm running into an issue with function template specialization and return type deduction in C++. The following minimal example is meant to demonstrate the problem (https://godbolt.org/z/WT1Prnfh6): #...
0 votes
1 answer
93 views
How to universally set dir=auto in about everywhere in any browser?
Please and before anything this is not only about YouTube. But YouTube is just an example. I am having an issue with YouTube comments that they are NOT displayed with HTML attribute dir=auto. So I am ...
0 votes
0 answers
15 views
Auto Zoom Feature for Custom extension in Oracle Analytics Server
I need to implement the auto zoom feature in the extension, along with the Zoom Control and Zoom Interaction On/Off functionalities, similar to those available in the Maps component of Oracle ...
0 votes
1 answer
119 views
No Android Auto application visibility on real car device after app uploaded on internal testing (Play Store)
I have an issue on Android Auto application visibility on real car device.This is Navigation app. We have uploaded our Android Auto app to the Play Store for internal testing, and it has been approved ...
0 votes
2 answers
136 views
error: expected primary-expression before ‘auto’
For reference: C++17 std::optional error: expected primary-expression before 'auto' My test code is below. My understanding is that my usage of auto in this context is as outlined in the above ...
3 votes
3 answers
219 views
Overcoming use of auto before deduction of 'auto'
When I implement a class I start with public interface and then continue with private details, which I think creates a good order for those that read the code: class Something { public: // ...
2 votes
1 answer
143 views
Using conversion operator with automatic return type deduction from base class
The following not very long program is treated differently by the current compilers: class A { protected: operator auto(); }; template<class> struct B : A { using A::operator auto; }; ...
0 votes
1 answer
79 views
C++ auto templated function overload ambiguity
#include <iostream> #include <concepts> struct Sound { int amplitude; }; struct Light { int brightness; }; template <typename T> concept Alert = std::derived_from<T, Sound> &...
0 votes
1 answer
113 views
How to create Voice Input in my own app in Android Auto?
In this page, it states that you can use Voice Input "to support building features such as an in-app digital assistant." I've been searching, but I can't find anything related to this voice ...
1 vote
0 answers
15 views
Auto add some product attributes when adding a new product in Woocommerce
How can I Auto add some product attributes when adding a new product in Woocommerce I need to add some attributes to each category separately Like Processor category Auto attributes A B C Motherboard ...