diff --git a/include/clad/Differentiator/DynamicGraph.h b/include/clad/Differentiator/DynamicGraph.h index db1113116..f7b5f61b0 100644 --- a/include/clad/Differentiator/DynamicGraph.h +++ b/include/clad/Differentiator/DynamicGraph.h @@ -106,7 +106,7 @@ template class DynamicGraph { bool isProcessingNode() { return m_currentId != -1; } /// Get the nodes in the graph. - std::vector getNodes() { return m_nodes; } + const std::vector& getNodes() { return m_nodes; } /// Print the nodes and edges in the graph. void print() { @@ -140,4 +140,4 @@ template class DynamicGraph { }; } // end namespace clad -#endif // CLAD_DIFFERENTIATOR_DYNAMICGRAPH_H \ No newline at end of file +#endif // CLAD_DIFFERENTIATOR_DYNAMICGRAPH_H