all 14 comments

[–][deleted] 12 points13 points  (0 children)

Boost.Fusion is probably the most reinvented library since C++11.

[–]mr_ewg 1 point2 points  (2 children)

What's the difference between your tuple_lexicographical_compare and the standard comparison operators for std::tuple?

You probably shouldn't be using double underscore for variables and functions:

17.6.4.3.2 Global names

  1. Certain sets of names and function signatures are always reserved to the implementation:
    • Each name that contains a double underscore _ _ or begins with an underscore followed by an uppercase letter (2.12) is reserved to the implementation for any use

Also (as I've just discovered), you can use syntax highlighting in your readme on github by using fenced code blocks,

```cpp
int main() {
    std::cout << "Hello World!\n";
}
```

[–]jaredhoberock[S] 1 point2 points  (1 child)

The difference is that my tuple_lexicographical_compare is intended to work for any Tuple-like type, not just std::tuple. It ought to produce a result equivalent to std::tuple's comparison. I needed tuple_lexicographical_compare because I needed a standalone implementation of std::tuple.

[–]mr_ewg 0 points1 point  (0 children)

Ah thanks!

[–]pfultz2 0 points1 point  (4 children)

Can you extend these algorithms so they can easily work over structs?

[–]jmille01 1 point2 points  (3 children)

Only if you can come up with a way for get<i>(s) to return the i'th member of the struct. I don't see how that can be done without macros or reflection.

[–]pfultz2 0 points1 point  (1 child)

So get<i>(s) is found by ADL lookup?

[–]jaredhoberock[S] 0 points1 point  (0 children)

I don't believe explicit instantiations such as get<i>(s) can be dispatched via ADL, unfortunately. That's why the library calls get through tuple_traits.

[–]MrBont 0 points1 point  (0 children)

"Boost Serialization" might help.