Xport Interface: stylesheet::iterator::operator ==, !=
Equality and inequality operators for stylesheet::iterator and stylesheet::const_iterator.
bool operator ==(const stylesheet::const_iterator& lhs, const stylesheet::const_iterator& rhs);
bool operator !=(const stylesheet::const_iterator& lhs, const stylesheet::const_iterator& rhs);
Parameters
lhs
The left iterator to compare.
rhs
The right iterator to compare.
Returns
Returns true if the stylesheet iterators point to the same stylesheet
item.
Remarks
Test two iterators for equality or inequality. These operation are not a member function, so they allow the conversion of iterator to const_iterator
for both the left and right arguments.
Complexity
Constant
Example
#include "xhtml_doc.h"
#include <iostream>
int main(int argc, char* argv[])
{
using namespace Xport;
stylesheet ss;
ss.insert(stylesheet_comment("Sample stylesheet"));
stylesheet::iterator it = ss.insert(stylesheet_rule("h1"));
*it << (declaration(text_align, "center"))
<< (declaration(css::color, "red"));
it = ss.insert(stylesheet_rule("p"));
*it << (declaration(margin_left, "10px"))
<< (declaration(font_size, "10pt"));
stylesheet_formatter fmtr(std::cout);
ss.write(fmtr);
std::cout << "\n\nWrite the stylesheet items individually.\n\n";
it = ss.begin();
for (; it != ss.end(); ++it) {
fmtr << *it;
std::cout << "\n\n";
}
}