Skip to main content
Best practices
0 votes
3 replies
94 views

I'm struggling to finalise the design of my C++17 library. One of the primary goals is to use runtime polymorphism to allow users to extend or rewrite default features of the library for their own use ...
josh_eime's user avatar
  • 176
3 votes
1 answer
127 views

As I understand it, std::polymorphic<T> and std::indirect<T> are const-propagating wrapper types for an owning pointer to a T object, where the target of the pointer is copied with the ...
dumbass's user avatar
  • 27.1k
3 votes
2 answers
88 views

I have a ProductLandedCost model with a morphToMany relationship to various other models: Warehouse, for example: class Warehouse extends Model { // ... public function productLandedCosts(): ...
Aaron Dunigan AtLee's user avatar
2 votes
3 answers
115 views

I have three processor classes that share a common interface for polymorphic behavior using std::variant and std::visit. Each processor has a processData() member function that internally consists of ...
Ali Sedighi's user avatar
2 votes
2 answers
207 views

I am trying to implement a Parent and Child class. The Parent class would start a thread and run a routine function. The Child class would override the routine function if needed.This seems perfectly ...
Zhiyong Li's user avatar
Best practices
1 vote
6 replies
225 views

I'm building a Qt wrapper for RtMidi. As starting point I created two separate classes QMidiOut and QMidiIn that wrap RtMidiOut and RtMidiIn. I don't want to duplicate code for the common methods (e.g....
NoobNoob's user avatar
  • 114
-1 votes
0 answers
83 views

so I'm building a project using C# in Visual Studio, and I'm running into an issue with my Json deserialization of my custom subclasses. Basically, I have all of the data for my project under one base ...
Over's user avatar
  • 9
5 votes
1 answer
140 views

Consider this Haskell code that compiles successfully: {-# LANGUAGE RankNTypes #-} -- Applies a polymorphic function to different types, expecting 3 constraints applyToMany :: (forall a. (Show a, Eq ...
Thomas's user avatar
  • 6,364
0 votes
0 answers
64 views

I have created a very simple demo project with one controller endpoint: Spring Boot 3.5.6 Springdoc 2.8.13 This was working much better in Spring Boot 2.7.x Full project here: https://github.com/...
Aslak's user avatar
  • 139
-1 votes
3 answers
196 views

I'm playing around with OOP in Python, and I have something like this: class Person: def __init__(self,name, age): self.name = name self.age = age self.hobbies = [] ...
Ranao's user avatar
  • 33
0 votes
2 answers
69 views

I don't understand why my class that extends an abstract class (which implements an interface) does not override the interface's single method. I get this error when I try to compile: MyIntListImpl ...
user27630372's user avatar
0 votes
0 answers
163 views

I am aware that calling delete this in a member function is not UB in itself. In fact, compiler is doing the very same thing when one calls delete ptr, ptr being a pointer to a polymorphic object (...
lobelk's user avatar
  • 531
1 vote
1 answer
111 views

Consider these model classes: [JsonPolymorphic(TypeDiscriminatorPropertyName = "$type")] [JsonDerivedType(typeof(A), typeDiscriminator: nameof(A))] [JsonDerivedType(typeof(B), ...
aepot's user avatar
  • 4,864
3 votes
1 answer
99 views

In The C++ Programming Language - 4th edition, in §25.3 at page 731-732 Bjarne Stroustrup shows a possible implementation of a Vector template class that's been specialized for all T* template ...
Enlico's user avatar
  • 30.3k
1 vote
0 answers
71 views

I've tried to use kotlinx.serialization with the third party Yaml plugin from @charleskorn. In the past I already did something with Python using pyyaml, where I explicitly set a custom yaml_tag for ...
9Lukas5's user avatar
  • 91

15 30 50 per page
1
2 3 4 5
696