[Xapian-devel] Re: [Xapian-discuss] Fixing issue with PHP5/Windows
Olly Betts
olly at survex.com
Thu Apr 5 10:42:17 BST 2007
On Thu, Apr 05, 2007 at 11:34:57AM +0200, Daniel M?nard wrote:
> Olly Betts a écrit :
> > string term = *i;
> > char *p = const_cast<char*>(term.data());
> > add_next_index_stringl(return_value, p, term.length(), 1);
>
> Nice: it compiles and now the test passes.
Great, thanks for checking. I've committed this to SVN HEAD and will
backport it shortly. Then I think I'll reroll 0.9.10.1 with this fix
in.
> note: in one of the previous version you sent, term was declared as
> "std::string", not "string" (I have no idea of what it means, perhaps
> it's a typo. The test works also if I put std::string in the code)
In C++, all the standard library stuff is in a "std" namespace. In the
library sources, we just put "using namespace std;" after the header
inclusion in each source file so you can omit the "std::", but it still
works to explicitly specify it.
However, in externally visible headers we always use "std::" explicitly,
since we should let the user decide if they want to import the namespace
or not (or to just import some things - "using std::vector;" just make
"vector" visible without the namespace, for example).
Cheers,
Olly
More information about the Xapian-devel
mailing list