Questions tagged [concept]

Concept programming is a programming paradigm focusing on how concepts that live in the programmer's head translate into representations that are found in the code space. This approach was introduced in 2001 by Christophe de Dinechin with the XL Programming Language.

Concept programming is a programming paradigm focusing on how concepts that live in the programmer's head translate into representations that are found in the code space. This approach was introduced in 2001 by Christophe de Dinechin with the XL Programming Language.

For more, see Wikipedia.

300 questions
2
votes
2 answers

Delegate protocol implementation on Swift (kinda conceptual)

I came across this scenario today and wondered if something like this already exists: a built in way to automatically delegate a protocol implementation in Swift. I know it'd be only syntax sugar on the code, but I'm actually more curious than in…
Mik
  • 31
  • 3
2
votes
1 answer

Why does std::istreambuf_iterator fail boost's SinglePassIterator concept check?

The following program: #include #include #include using boost::range_detail::SinglePassIteratorConcept; int main() { BOOST_CONCEPT_ASSERT((…
HighCommander4
  • 50,428
  • 24
  • 122
  • 194
2
votes
2 answers

template class method specialization using concepts

There is a template class A with template parameter T. I want this class to have a method f if T is of integral types. The class A also has a lot of other methods, so I don't want to have specialization of overall A. I understand that this problem…
Maksim Surov
  • 603
  • 6
  • 22
2
votes
1 answer

implement a C++20 concept

How can I programatically implement a concept as if it were an actual "interface"? For example, I was trying recently to write a contigious iterator for a custom container. And because contigious iterators have a lot of traits, I wanted to make sure…
modanashar
  • 151
  • 2
  • 9
2
votes
2 answers

Concept-restricted range-based for loop of std::list>

I have some class Foo and a std::list> and would like to iterate over its elements with a range-based for loop: #include #include #include class Foo { public: Foo(int a) : a(a) {} …
2
votes
1 answer

Azure RBAC Custom Roles

I am currently trying to work out a concept for a roles and rights concept. Azure RBAC already has a few built-in roles but I am trying to create a few more custom roles. Are custom roles directly linked to the RBAC? And does anyone have any…
kjnns
  • 21
  • 1
2
votes
2 answers

How to write a c++ concept for class with member function template that takes a template argument?

How can I write a C++ 20 concept requiring a member function template that takes a template argument that must be provided? The goal of the following concept is to check that a type is tuple-like, except rather than checking std::get(t) I want to…
koraxkorakos
  • 369
  • 1
  • 10
2
votes
3 answers

Microservice architecture conceptual problem - microservice data and boundaries

I have conceptual/design problem which I am not able to solve. I will try to explain it on sport terminology example, but of course same problem can be applied to e-shop or any other system. I want to build 2 "standalone" micro services with API to…
2
votes
1 answer

How to write concepts that make use of ADL

I would like to write a concept that would allow me to verify if a given statement, using ADL, is valid and has a proper return type. In my specific case, I want to write a String concept that should enforce the following requirements: The type has…
Rerito
  • 5,886
  • 21
  • 47
2
votes
0 answers

Templated Concept as a compile-time interface in C++20

I'm trying to implement a concept that is templated itself can be used as a compile-time interface. How is this possible with C++20? Example: Let's have a matrix inversion utility that accepts a decomposition functor as "dependency injection"…
cyau
  • 449
  • 4
  • 14
2
votes
1 answer

How to write a c++ concept for Heuristic function

I am implementing a search algorithm with heuristic function in c++ 20. I'm trying to constrain the function my algorithm can use with a concept like so: template concept Heuristic = requires(SelfType…
2
votes
0 answers

What's the difference of "-a" and "-i" between ''docker create" and "docker start"

The regular workflow of docker is: first docker create, then docker start. What make me confused are: Question 1 docker create has an option -a to specify which of stdin, stdout, stderr are attached to the container. docker start also has the same…
xmllmx
  • 39,765
  • 26
  • 162
  • 323
2
votes
2 answers

What does it mean in PHP to traverse arrays?

I was wondering what does it mean in layman's terms to traverse php arrays
HELP
  • 14,237
  • 22
  • 66
  • 100
2
votes
2 answers

How to use a Double Dispatch with overload in JAVA?

I'm trying to create a double dispatch in JAVA to use overloaded methods. public abstract class ComposantOrdi { protected void equiv(ComposantOrdi c){ Equivalence.equiv(this, c); } } public class Montage extends ComposantOrdi{ …
FL0Nn
  • 53
  • 1
  • 7
2
votes
4 answers

Is there any spreadsheet which use a formula repository instead of writing several copies directly in the cell?

I like speradsheet programs, but there is a disturbing thing with them: the formulas must be entered in the cells. It has several withdraws: I need to scan thru all the cells to see, what's going in a sheet; if I change a formula, I must copy it to…
ern0
  • 3,074
  • 25
  • 40