Skip to content

Bug Report: System fails when object lacks defaults constructor.ย #3

@gem870

Description

@gem870

Describe the bug
When declaring a class with only a parameterized constructor, the system throws an error or fails during instantiation. This seems to occur when the framework or serialization logic expects a default (no-argument) constructor.

To Reproduce
Steps to reproduce the behavior:

  • Create a class with only a constructor that takes parameters.
  • Attempt adding the object using the addItem() function.
  • Observe the failure or exception.

Example Code:

    class Product {
        public:
          Product(std::string name, double price) : name(name), price(price) {}
  
        private:
          std::string name;
          double price;
    };

Expected behavior
The system should either handle parameterized constructors gracefully or provide a clear error message. Alternatively, documentation should specify that a default constructor is required.

Workaround:
Add a default constructor manually:

    Product() : name(""), price(0.0) {}

Additional Notes:
This issue may affect serialization, deserialization, or object pooling mechanisms that rely on default instantiation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions