doom_Oo7
u/doom_Oo7
Hello,
I am trying to simplify some code thanks to C++17 new features.
In particular, I was interested in template<auto> : the promise was that it would help to simplify passing callback functions, e.g. no need anymore to do stuff such as template<typename T, typename R, R (T::*ptr)(Args...)> to pass member functions. (see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0127r1.html section "Motivation")
In practice, I had existing code that was doing the following :
connect<MyClass, &MyClass::blah>(...);
which I wanted to shorten to
connect<&MyClass::blah>(...);
alas ! It apparently only works with non-template arguments, an
Cutelyst 2, a Qt/C++ web framework, released with HTTP/2 support
cutelyst.org/2018/03/20/cutelyst-2-released-w...Given the following example :
CMakeLists.txt:
cmake_minimum_required(VERSION 3.10)
project(export_templates CXX)
include(GenerateExportHeader)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
add_library(mylib SHARED header.hpp mylib.cpp)
generate_export_header(mylib)
add_executable(myexe header.hpp main.cpp)
target_link_libraries(myexe mylib)
header.hpp:
#pragma once
#include <vector>
template<typename T>
struct foo
{
std::size_t bar() {
std::vector<T> t;
t.resize(10);
return t.size();
}
};
extern template st
A simple framework for creating embedded DSL in Scala
users.scala-lang.org/t/announcing-dsl-scala-a...[...] we plan to put more resources on widgets going forward, and increase the activity level around the module in general.
blog.qt.io/blog/2018/03/05/qt-customer-survey...Hello everyone, I have been granted moderation rights for this subreddit due to the inactivity of its previous mod. I've started cleaning up the chinese spam and rejuvenating the links on the right side with more up-to-date information.
I will leave this post sticky for some time: if anyone has ideas for improvements or see missing things, please share it here :)