Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CXX-Qt-Lib: Add CXX-compatible templates for make_unique, make_shared, etc. #823

Open
4 of 6 tasks
LeonMatthesKDAB opened this issue Jan 26, 2024 · 2 comments
Open
4 of 6 tasks
Assignees
Labels
⬆️ feature New feature or request 🙋 good first issue Good for newcomers

Comments

@LeonMatthesKDAB
Copy link
Collaborator

LeonMatthesKDAB commented Jan 26, 2024

To complete our list of templated constructors in cxx-qt-lib/common.h.

We probably want to have at least:

@LeonMatthesKDAB LeonMatthesKDAB added ⬆️ feature New feature or request 🙋 good first issue Good for newcomers labels Jan 26, 2024
@ahayzen-kdab
Copy link
Collaborator

Note this is also something that if cxx-qt-lib is split out could go into cxx-qt or a -common thing later 🤔

@ahayzen-kdab
Copy link
Collaborator

See comments in #840, consider having an up and downcast helper

template<typename Base, typename T>
Base & upcast(T& t)
{
   // Maybe add some static_assert that Base is indeed base class of T
    return static_cast<Base&>(t);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⬆️ feature New feature or request 🙋 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants