On Sat, Aug 31, 2019 at 1:09 PM Murray Cumming <murr...@murrayc.com> wrote: > > On Thu, 2019-08-29 at 17:07 -0400, Robert Middleton wrote: > > There are two suggestions that I have before a release is made: > > 1. Add in more examples, the two that are there are very simple and > > not very helpful(I can help adding some examples, but I don't have > > great knowledge of how everything works together). > > Do you mean here? > https://developer.gnome.org/libsigc++-tutorial/unstable/ >
Partially there; the example may not be bad, but since the code in the tutorial is not in the examples directory it's not something that you can simply grab and start working with. > or here? > https://github.com/libsigcplusplus/libsigcplusplus/tree/master/examples > > or both? > > What do you think should be shown in an example? > Some things that I would like to see: * An example of different signal types - most of the signals have one (or two) params, but showing signals that have multiple params and return values would be useful. This is talked about briefly in the tutorial but it's not expanded upon in any way. * When exactly to extend from sigc::trackable. It's not covered at all in the tutorial, and I'm not sure exactly when this is supposed to be used. * How exactly an accumulator is used. The library that I'm working it on uses it in a few places[1], but I'm not exactly sure why nor what the point of the accumulator exactly is. * How to use with Qt(this is something that I have experience in and is a use-case for me, so I can contribute an example) * A quick guide on going from libsigc++-2.0 to libsigc++-3.0. The biggest thing that I can see is the differences in the template, so instead of using sigc::slot1<void,int>(or something like that) it is now sigc::slot<void(int)>. * How to pass a sigc::slot to a function(it took me a while to figure this out earlier, I eventually figured out it had to be template<typename T_type> void function(sigc::slot<T_type> slot_name) ) * The example code that is in the tutorial would be really great to have in the examples directory, so that you can easily compile and test it out to get it working. I always find it difficult to read a tutorial and not have the complete code available to read through. The tutorial does talk about example1.cc and example2.cc, but they are nowhere to be found. > Most uses of libsigc++ should be quite simple, and I'm a little afraid > of making it seem otherwise. > In my mind there are several levels: the basic level(that is covered by the tutorial), and more detailed examples(mostly what I have listed above). Since the tutorial also follows a progression of adding new things/making it more complicated, that also helps to show the simple use-case, and then leads into more advanced use-cases. Related to that, Qt does have a pretty good guide on how/why signals/slots are used[2]. Before I started doing heavy Qt-based work, I was very confused as to why the signals/slots were needed, so some kind of basic overview would be helpful(but not required). Also I see that the website does not mention C++17 at all; I know the current version does require C++17. > > 2. I noticed that there are only 4 c++ files that are actually > > compiled into the library; would it make sense to put those in the > > headers so that libsigc++ would become a header-only library? > > Being a header-only library could have its uses, but it would have some > downsides: > > - That code in the .cc files can currently be changed without breaking > ABI. But once it is in the headers, we need to be very careful about > compatibility between different libraries compiled against different > minor versions of libsigc++. > - Even longer compile times (maybe not significant in this case). How does the code in the .cc file allow you to not break the ABI? Woudln't that only be the case if you added/removed member variables from the libsigc++ classes, which are already in the header anyway? -Robert Middleton [1]: https://github.com/dbus-cxx/dbus-cxx/blob/f37317ed557eb4c58fe4e2837cfc0a7fc585f6a8/dbus-cxx/accumulators.h#L76 [2]: https://doc.qt.io/qt-5/signalsandslots.html _______________________________________________ libsigc-list mailing list libsigc-list@gnome.org https://mail.gnome.org/mailman/listinfo/libsigc-list