Xport Interface: operator ==
Compares two declaration objects for equality.
bool operator ==(
const declaration& lhs,
const declaration& rhs
);
Parameters
lhs
The lhs object to compare.
rhs
The rhs object to compare.
Returns
true
if the declaration
objects are equal, false
otherwise.
Remarks
This operation compares two declarations for equlity. Two declarations's are equal if their properties and values are equal.
Complexity
Constant
Example
#include "xhtml_doc.h"
#include <iostream>
int main(int argc, char* argv[])
{
using namespace Xport;
stylesheet_rule rule1("p");
stylesheet_rule rule2("p");
rule1 << declaration(margin_top, "10px");
rule2 << declaration(margin_top, "10px");
rule1 << declaration(padding_left, "5px");
rule2 << declaration(padding_right, "5px");
rule1 << declaration(css::color, "red");
rule1 << declaration(css::color, "maroon");
for (int i = 0; i < 3; ++i) {
std::cout << "Declarations " << i << " are " << (rule1[i] == rule2[i] ? "equal" : "not equal") <<
".\n";
}
std::cout << "\n\n";
}