Rapptz / sol

A C++11 Lua wrapper
MIT License
208 stars 32 forks source link

v2.0 Changes - VS 2015 Support, `usertype`, and more #51

Closed ThePhD closed 9 years ago

ThePhD commented 10 years ago

This pull request anticipates changes to clean up some of the internals from the scars of Visual Studio 2013 and introduce proper support that is actually possible starting with Visual Studio 2015 CTP 2.

It also proposes alternative naming for the userdata and new_userdata idioms, adopting the term usertype. usertype more appropriately encapsulates what we mean, while having enough of the same parts (user) to, in the API end-user's mind, be similar to lua's concept of usertype.

This also makes it easier to have an actual userdata<T> class that actually represents a userdata, and we can convey semantics (userdata<T> versus userdata<T&> versus userdata<T*> through pusher and getter, as the unqualified<userdata<T&>> won't affect the inner specified class).

It introduces a deprecation mechanism to make things easier for individuals to transition: the deprecation mechanism has been confirmed to work on Clang, GCC, and VC++.

rightfold commented 10 years ago

Add deprecated aliases for backwards compatibility.

Rapptz commented 9 years ago

You're terrible at branches.

ThePhD commented 9 years ago

vOv I thought I did it properly.

Rapptz commented 9 years ago

It's okay bud.

I don't like this new terminology. So I don't know what I'm going to do with this PR.

ThePhD commented 9 years ago

Probably nothing. It breaks the interface anyways, so I don't know what to do either. usertype feels like a good name but honestly there's probably better.

Rapptz commented 9 years ago

Somehow this PR lost its ability to automatically merge lol.

ThePhD commented 9 years ago

It's because of the goddamn std::size_t -> int on the usertype / userdata bits...

I'm tempted to keep it std::size_t and add a specialization for 0 so there's no function to call. Or some proper overloading if I > 0, so clang can properly shut up.

Rapptz commented 9 years ago

I don't see how that change would cause a merge conflict. You didn't touch that bit so there's no conflict. Odd.

ThePhD commented 9 years ago

I changed the userdata line in the gc function to usertype. Apparently, git's conflating the template <int I> line with the line below it, and calling the whole thing a merge conflict. v:

ThePhD commented 9 years ago

This pull request is confirmed to be compatible with the changes to lua-5.3.0, and is backwards compatible with lua-5.2.3. Support for lua-jit is still hanging in the air.

Rapptz commented 9 years ago

This PR is going to be merged into the develop branch which is where all v2.0 development will take place.