Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Refactoring Moveable
Re: Refactoring Moveable [message #61380 is a reply to message #61378] Fri, 03 January 2025 08:37 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
Novo wrote on Thu, 02 January 2025 21:41
A little bit of criticism.
Code below won't compile out of the box:
namespace test {
    struct Test;
}

namespace test {
    struct Test : Moveable<Test> {

        Vector<Test> children;
    };
}

Adding of
template <> inline constexpr bool is_upp_guest<test::Test> = true;

won't help.
You need to add
template <> inline constexpr bool is_trivially_relocatable<test::Test> = true;

All this stuff is inconvenient and unnatural.

And I have no idea how to make code below compile.
struct Test01;

struct Test01 {

    struct Test02 : Moveable<Test02> {

        Vector<Test02> children;
    };
};


Well, it is sort of obvious, right?

Anyway, easy fix is to move the static_assert to destructor. It however has the price of less clear error and also only gets triggered when you instatiate Test02.

Do we want to go there? Or any other ideas?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Dynamic skin changes...
Next Topic: Broken compilation
Goto Forum:
  


Current Time: Tue Aug 12 19:28:48 CEST 2025

Total time taken to generate the page: 0.13406 seconds