GabrielDosReis/ipr

ipr::Unit seems to be missing

Opened this issue · 2 comments

The very first example from the doc doesn't build. It seems to be out of date, as there is no struct called Unit in source code.

Yes, the doc is outdated.

Can you point towards some "Hello, IPR" code where one could dissect a simple function declaration?

// IPR includes
#include <ipr/impl>
#include <ipr/io>

// Standard C++ includes
#include <iostream>
#include <string>

template<class E>
void inspect(const E& e)        // Print a expression and its type.
{
   ipr::Printer pp(std::cout);  // Create an XPR pretty printer
                                // tied to std::cout.
   pp << ipr::xpr_expr(e);      // Output e in XPR notation.
   pp << " has type ";
   pp << ipr::xpr_expr(e.type()); // Output type of e in XPR notation.
   std::cout << std::endl;
}

constexpr auto code =
   "double add(double a, double b) { return a + b; }";

int main()
{
   ipr::??? expr{ code };
   
   inspect(expr);

   return 0;
}

I would very much like to experiment with IPR/XPR and potentially contribute. How much have the internals changed since the doc was last updated? I see there are references to modules and interfaces which hint at being used for the developement of the modules TS. Am I right, or are those different notions?