make c'tor of StaticGraph::InputEdge variadic to be more flexible against changing EdgeData types

This commit is contained in:
Dennis Luxen 2014-07-14 17:16:28 +02:00
parent 3de98f7a9d
commit 96f29c27cd

View File

@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <algorithm> #include <algorithm>
#include <limits> #include <limits>
#include <utility>
#include <vector> #include <vector>
template <typename EdgeDataT, bool UseSharedMemory = false> class StaticGraph template <typename EdgeDataT, bool UseSharedMemory = false> class StaticGraph
@ -55,7 +56,9 @@ template <typename EdgeDataT, bool UseSharedMemory = false> class StaticGraph
EdgeDataT data; EdgeDataT data;
NodeIterator source; NodeIterator source;
NodeIterator target; NodeIterator target;
InputEdge(NodeIterator source, NodeIterator target, EdgeDataT data) : source(source), target(target), data(data) { }
template<typename... Ts>
InputEdge(NodeIterator source, NodeIterator target, Ts &&...data) : source(source), target(target), data(std::forward<Ts>(data)...) { }
bool operator<(const InputEdge &right) const bool operator<(const InputEdge &right) const
{ {
if (source != right.source) if (source != right.source)