|
Boost-Commit : |
From: joel_at_[hidden]
Date: 2008-04-26 23:21:13
Author: djowel
Date: 2008-04-26 23:21:12 EDT (Sat, 26 Apr 2008)
New Revision: 44806
URL: http://svn.boost.org/trac/boost/changeset/44806
Log:
tweak: const correctness
Text files modified:
trunk/libs/spirit/example/qi/calc5.cpp | 6 +++---
trunk/libs/spirit/example/qi/calc6/calc6.hpp | 2 +-
trunk/libs/spirit/example/qi/calc6/calc6a.cpp | 4 ++--
trunk/libs/spirit/example/qi/calc7/calc7.hpp | 2 +-
trunk/libs/spirit/example/qi/calc7/calc7a.cpp | 4 ++--
5 files changed, 9 insertions(+), 9 deletions(-)
Modified: trunk/libs/spirit/example/qi/calc5.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/calc5.cpp (original)
+++ trunk/libs/spirit/example/qi/calc5.cpp 2008-04-26 23:21:12 EDT (Sat, 26 Apr 2008)
@@ -60,7 +60,7 @@
}
int top() const { return stack_ptr[-1]; };
- void execute(std::vector<int>& code);
+ void execute(std::vector<int> const& code);
private:
@@ -68,9 +68,9 @@
std::vector<int>::iterator stack_ptr;
};
-void vmachine::execute(std::vector<int>& code)
+void vmachine::execute(std::vector<int> const& code)
{
- std::vector<int>::iterator pc = code.begin();
+ std::vector<int>::const_iterator pc = code.begin();
stack_ptr = stack.begin();
while (pc != code.end())
Modified: trunk/libs/spirit/example/qi/calc6/calc6.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/calc6/calc6.hpp (original)
+++ trunk/libs/spirit/example/qi/calc6/calc6.hpp 2008-04-26 23:21:12 EDT (Sat, 26 Apr 2008)
@@ -52,7 +52,7 @@
}
std::vector<int> const& get_stack() const { return stack; };
- void execute(std::vector<int>& code, int nvars);
+ void execute(std::vector<int> const& code, int nvars);
private:
Modified: trunk/libs/spirit/example/qi/calc6/calc6a.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/calc6/calc6a.cpp (original)
+++ trunk/libs/spirit/example/qi/calc6/calc6a.cpp 2008-04-26 23:21:12 EDT (Sat, 26 Apr 2008)
@@ -6,9 +6,9 @@
=============================================================================*/
#include "calc6.hpp"
-void vmachine::execute(std::vector<int>& code, int nvars)
+void vmachine::execute(std::vector<int> const& code, int nvars)
{
- std::vector<int>::iterator pc = code.begin();
+ std::vector<int>::const_iterator pc = code.begin();
std::vector<int>::iterator locals = stack.begin();
stack_ptr = stack.begin() + nvars;
Modified: trunk/libs/spirit/example/qi/calc7/calc7.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/calc7/calc7.hpp (original)
+++ trunk/libs/spirit/example/qi/calc7/calc7.hpp 2008-04-26 23:21:12 EDT (Sat, 26 Apr 2008)
@@ -71,7 +71,7 @@
}
std::vector<int> const& get_stack() const { return stack; };
- void execute(std::vector<int>& code, int nvars);
+ void execute(std::vector<int> const& code, int nvars);
private:
Modified: trunk/libs/spirit/example/qi/calc7/calc7a.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/calc7/calc7a.cpp (original)
+++ trunk/libs/spirit/example/qi/calc7/calc7a.cpp 2008-04-26 23:21:12 EDT (Sat, 26 Apr 2008)
@@ -9,9 +9,9 @@
# pragma warning(disable: 4800) // forcing value to bool 'true' or 'false'
// (performance warning)
-void vmachine::execute(std::vector<int>& code, int nvars)
+void vmachine::execute(std::vector<int> const& code, int nvars)
{
- std::vector<int>::iterator pc = code.begin();
+ std::vector<int>::const_iterator pc = code.begin();
std::vector<int>::iterator locals = stack.begin();
stack_ptr = stack.begin() + nvars;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk