Guest User

Untitled

a guest
Jun 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. // EXPLAIN (wash): Retrieve a numeric utree as an integral/floating point
  2. // type. Symbol utrees will return either a Karma (in the future,
  3. // construe_cast) converted value, or throw conversion_error/assertion.
  4. // Container utrees will also throw/assert.
  5. template<class T>
  6. typename enable_if<is_integral<T>, boost::intmax_t>::type get (void) const;
  7. template<class T>
  8. typename enable_if<is_floating_point<T>, double>::type get (void) const;
  9. // EXPLAIN (wash): Retrieve a symbol utree as an string. If the utree is
  10. // a numeric, the value of the utree is converted to a string (using Karma;
  11. // in the future it should use construe_cast, once construe_cast is added to
  12. // Boost). If the utree is a sequence, conversion_error is thrown/assertion
  13. // will occur. Record utrees will exhibit user-defined behavior.
  14. template<class T>
  15. typename enable_if<is_same<T, std::string>, std::string>::type
  16. get (void) const;
  17. template<class T>
  18. typename enable_if<is_same<T, char const*>, char const*>::type
  19. get (void) const;
  20. // EXPLAIN (wash): Get a sequence utree as an arbitrary STL Container with
  21. // value_type utree. If the utree is not a sequence, return an instance of
  22. // said arbitrary STL Container with the current utree as it's only element.
  23. // This is only useful if you need repeated random access to a sequence utree
  24. // (aka enough random access that it's cheaper to copy the sequence to a
  25. // dynamic array first). This will be used for the utree to client AST
  26. // translation framework.
  27. template<class T>
  28. typename enable_if<is_class<T>, T>::type get (void) const;
Add Comment
Please, Sign In to add comment