[Networkit] request for comments: new API for edge attributes

Hamann, Michael (ITI) michael.hamann at kit.edu
Thu Jul 31 17:36:08 CEST 2014


On 30.07.2014 23:15, Florian Weber wrote:
> Concerning the new code: You are using the long form of enable_if which
> gets very ugly, very fast. Among other things I would recommend to use
> the AUX_REQUIRE-macro¹ in StringBuilder.h that allows you to both
> describe what you require and removes much boilerplate:
> template<typename T,
>           AUX_REQUIRE(SomeDescription, std::is_integral<T>::value)>
> void some_method_that_only_works_with_integral_arguments(T arg) { ... }

Feel free to simplify the code, I'm not sure though you can remove much 
boilerplate as most code is actually for specifying the requirement 
using the function traits (which should be more generalized as shown on 
http://functionalcpp.wordpress.com/2013/08/05/function-traits/). The 
rest of the code is the code that is suggested in the documentation of 

Make sure you test by compiling the test cases as the iterators for 
incoming edges (which require explicitly setting the template 
parameters) are only used in the graph test.


More information about the NetworKit mailing list