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

Reconstructing a method piecewise from meta::source #297

Open
jcelerier opened this issue Apr 24, 2021 · 1 comment
Open

Reconstructing a method piecewise from meta::source #297

jcelerier opened this issue Apr 24, 2021 · 1 comment

Comments

@jcelerier
Copy link

jcelerier commented Apr 24, 2021

Hello,
Given for instance

struct(my_metaclass) TheClass {
   [[some_attributes]]
   template<typename A, std::size_t N, typename... Args>
   static constexpr inline auto foo(A a, int arr[N], Args&&... args) 
     /* cv-qual if not static */ 
     /* & / && if not static */
     noexcept(noexcept(false)) 
    -> decltype(a) try {
     return 0;
   } catch(...) {
     return 1;
   }
};

what would be the metaclass code (if possible) that given a meta::info corresponding to foo, would allow to recreate foo exactly as it is - but not by doing -> the_meta_info;, instead by reconstructing it piecewise (in order to have a starting point to make modifications on it).

thanks !

@jcelerier
Copy link
Author

jcelerier commented Apr 24, 2021

just having a starting point to do this with

struct(my_metaclass) TheClass {
   int foo(int x) { return x + 1; }
};

would already be great (context is, I'm trying to see how much one could reimplement noexcept purely with injection)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant