55,726 questions
1
vote
1
answer
41
views
How can I re-render a parent div element when its @if child content changes?
I have a tooltip element floating above the cursor. The size of the tooltip is obviously dependent on its content. I also need the tooltip to be completely visible inside the viewport, thus I set the ...
Advice
0
votes
8
replies
93
views
During template argument deduction and substitution of function template, do class template specialization get implicily instantiated?
Respected users, When a template function is called then during template argument deduction and substitution (which happens before overload resolution) of function template, do function parameter ...
2
votes
0
answers
114
views
Adapter/Decorator pattern from "Hands-on Design Patterns with C++"
I have the following classes adapted from the section "Adapter versus policy" page 515 of "Hands-on Design Patterns with C++":
a Value class with basic operations
decorators/...
1
vote
1
answer
191
views
C++ ambiguous operator even though static assert fails [duplicate]
At compile time, one of the various similar errors are:
fixed_test.cpp:6:32: note: there are 3 candidates
6 | std::cout<<a<<"+"<<b<<"="<<(a+b)&...
0
votes
1
answer
152
views
Templates templates with extra parameters for reuse
I have a class model that is good case for CRTP templates. Most information is static, the classes are singletons, therefore I can access them using their type names as opposed to object references.
...
2
votes
1
answer
145
views
Class template argument deduction with braces around one of scalar initializers
I have an aggregate class template with two element array inside:
template<typename T>
struct A { T t[2]; };
and I would like to initialize an object of this class using class template argument ...
3
votes
2
answers
213
views
How to make changes in a .tpp template implementation file trigger recompilation in a Makefile?
I'm using .tpp files to store template implementations.
However, modifying a .tpp file does not trigger recompilation, because Make does not generate an .o file from a .tpp source.
Still, these ...
5
votes
1
answer
268
views
What is the purpose of std::type_identity in std::vector's constructors?
I think I understand the purpose of std::type_identity_t, that it's supposed to help in the scenario where type deduction of a template does not require all template arguments to determine the ...
Best practices
0
votes
1
replies
104
views
PDF generation method
I am working on a project right now which is to create a synthetic data generation agent. My agent will receive some PDF like a bank statement and bank reconciliation which are related to each other, ...
Advice
0
votes
0
replies
60
views
As a developer, which would you choose to build with Builder or Template?
AI Website Builders vs. Ready-Made Templates: Which offers better long-term scalability and Affordability ?
I have been working in the SEO and admin templates industry since 2017, and I am seeing a ...
0
votes
1
answer
91
views
Extern function template declaration inside template function
I have a template function for which all instantiations will be done via generated template specialization codes.
template <typename Type>
std::vector<std::string> get_members()
{
...
Best practices
0
votes
1
replies
46
views
What is the best way to build a photobook template system for a web editor?
I'm building a photobook website where users can upload photos and create their own photobooks from templates.
The problem is I don't have experience with building a photo editor or template system.
I'...
4
votes
1
answer
152
views
How to write a binary function template that accepts four parameter permutations of const reference and rvalue reference in C++?
To explan my question, I'll use a simplied example here:
Given a struct with a vector in it and I need to do something with it (e.g., concatenate with another).
Considering its size, flexibility and ...
Advice
0
votes
6
replies
134
views
CRTP with Multilevel Inheritance and Mixins
I have an implementation of CRTP with multilevel inheritance that I think works pretty well. Any external method call will always call the most derived implementation. Furthermore, if any method ...
4
votes
2
answers
174
views
Set tuple values, inferring type from const array of std::variant
Greggs is a class which contains the tuple sausage_roll and const array flavours. The tuple contains ints and strings whilst the array is made up of variants.
The makeOrder method should set a value ...