1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

fix net/endian.hpp

This commit is contained in:
bolero-MURAKAMI 2014-06-05 16:44:19 +09:00
parent 7f8a352783
commit 93e22a984d
10 changed files with 651 additions and 10 deletions

View file

@ -0,0 +1,42 @@
/*=============================================================================
Copyright (c) 2011-2014 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef TOOLS_SPRIG_GRAPH_BACK_EDGE_RECORDER_HPP
#define TOOLS_SPRIG_GRAPH_BACK_EDGE_RECORDER_HPP
#include <boost/graph/depth_first_search.hpp>
namespace sprig {
//
// back_edge_recorder
//
template<typename OutputIterator>
struct back_edge_recorder
: public boost::default_dfs_visitor
{
private:
OutputIterator out_;
public:
explicit back_edge_recorder(OutputIterator out)
: out_(out)
{}
template<typename Edge, typename Graph>
void back_edge(Edge const& e, Graph const&) {
*out_++ = e;
}
};
//
// make_back_edge_recorder
//
template<typename OutputIterator >
inline sprig::back_edge_recorder<OutputIterator>
make_back_edge_recorder(OutputIterator out) {
return sprig::back_edge_recorder<OutputIterator>(out);
}
} // namespace sprig
#endif // #ifndef TOOLS_SPRIG_GRAPH_BACK_EDGE_RECORDER_HPP

View file

@ -0,0 +1,13 @@
/*=============================================================================
Copyright (c) 2011-2014 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef TOOLS_SPRIG_GRAPH_DEPTH_FIRST_SEARCH_HPP
#define TOOLS_SPRIG_GRAPH_DEPTH_FIRST_SEARCH_HPP
#include "./back_edge_recorder.hpp"
#endif // #ifndef TOOLS_SPRIG_GRAPH_DEPTH_FIRST_SEARCH_HPP