Path: utzoo!mnetor!uunet!cadnetix.COM!gad From: gad@cadnetix.COM (Gordon Durand) Newsgroups: comp.lang.c++ Subject: Strange behaviour with some OOPS SubStrings. Message-ID: <2100@cadnetix.COM> Date: 24 Feb 88 00:00:10 GMT Organization: Cadnetix Corp., Boulder, CO Lines: 44 I've run into an interesting problem when using OOPS Strings and SubStrings, specifically the function SubString::operator==(const String&). If I have a conditional which AND's two comparisons between strings and substrings, I get the following: CC -DBOTCH StringBotch.C -loops: ...warning about a bitwise copy in String.h... cc StringBotch..c -loops -lC "/usr/include/oops/String.h", line 42: redeclaration of _SubString__eq If I break the AND into nested if statements, the problem goes away! An example is included below, compiling with -DBOTCH causes problems. Configuration info: Sun 3/50 with SunOS 3.4, AT&T C++ 1.2.1, OOPS Version 2 (installation notes dated 4/13/87) Is this a problem with OOPS, C++, or my feeble mind? =================================================================== #include main() { String Line ("byebye"); String Bye ("bye"); #ifdef BOTCH if (Line (0, 3) == Bye && Line (3, 3) == Bye) { // This will break. printf ("Yup, Line was byebye\n"); } #else BOTCH if (Line (0, 3) == Bye) { // This is fine. if (Line (3, 3) == Bye) { printf ("Yup, Line was byebye\n"); } } #endif BOTCH } =================================================================== -- Gordon Durand Internet: gad@cadnetix.com Cadnetix Corp. UUCP: cadnetix!gad 5775 Flatiron Pkwy. {uunet,boulder,nbires}!cadnetix!gad Boulder, CO 80301