This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
#include <boost/iostreams/filtering_stream.hpp> ... filtering_stream<input> foo; foo.push(zlib_decompressor()); //unable to resolve identifier push From 'filtering_stream.hpp': ... '// Macro: BOOST_IOSTREAMS_DEFINE_FILTER_STREAM(name_, chain_type_, default_char_) // Description: Defines a template derived from std::basic_streambuf which uses // a chain to perform i/o. The template has the following parameters: // Mode - the i/o mode. // Ch - The character type. // Tr - The character traits type. // Alloc - The allocator type. // Access - Indicates accessibility of the chain interface; must be either // public_ or protected_; defaults to public_. // Macro parameters: // name_ - The name of the template to be defined. // chain_type_ - The name of the chain template. // default_char_ - The default value for the char template parameter. // #define BOOST_IOSTREAMS_DEFINE_FILTER_STREAM(name_, chain_type_, default_char_) \ template< typename Mode, \ typename Ch = default_char_, \ typename Tr = BOOST_IOSTREAMS_CHAR_TRAITS(Ch), \ typename Alloc = std::allocator<Ch>, \ typename Access = public_ > \ class name_ \ : public boost::iostreams::detail::filtering_stream_base< \ chain_type_<Mode, Ch, Tr, Alloc>, Access \ > \ { \ public: \ typedef Ch char_type; \ struct category \ : Mode, \ closable_tag, \ detail::filtering_stream_traits<Mode, Ch, Tr>::stream_tag \ { }; \ BOOST_IOSTREAMS_STREAMBUF_TYPEDEFS(Tr) \ typedef Mode mode; \ typedef chain_type_<Mode, Ch, Tr, Alloc> chain_type; \ name_() { } \ BOOST_IOSTREAMS_DEFINE_PUSH_CONSTRUCTOR(name_, mode, Ch, push_impl) \ ~name_() { \ if (this->is_complete()) \ this->rdbuf()->BOOST_IOSTREAMS_PUBSYNC(); \ } \ private: \ typedef access_control< \ boost::iostreams::detail::chain_client< \ chain_type_<Mode, Ch, Tr, Alloc> \ >, \ Access \ > client_type; \ template<typename T> \ void push_impl(const T& t BOOST_IOSTREAMS_PUSH_PARAMS()) \ { client_type::push(t BOOST_IOSTREAMS_PUSH_ARGS()); } \ }; \ /**/ BOOST_IOSTREAMS_DEFINE_FILTER_STREAM(filtering_stream, boost::iostreams::chain, char) BOOST_IOSTREAMS_DEFINE_FILTER_STREAM(wfiltering_stream, boost::iostreams::chain, wchar_t) typedef filtering_stream<input> filtering_istream; typedef filtering_stream<output> filtering_ostream; typedef wfiltering_stream<input> filtering_wistream; typedef wfiltering_stream<output> filtering_wostream;'
Hello. I had out of memory exception. Now I've fixed it. But push is still unresolved. And I can not compile your example too. With other functions everything is ok (after fixing of out of memory exception). -- #include <boost/iostreams/filtering_stream.hpp> int main() { boost::iostreams::filtering_stream<boost::iostreams::input> foo; foo.get(); // resolved return 0; } -- or #include <boost/iostreams/filtering_stream.hpp> int main() { boost::iostreams::filtering_stream<boost::iostreams::output> foo; foo.put('c'); return 0; } -- Do you have any completion after foo? Could you provide some simple compilable example? I'll put my current changes tomorrow. And they will be in the nightly build the day after tomorrow.
Hello, Julian. I can not compile your code with g++-4.3.2 and Sun Studio 12.1. With other functions (get, put) it works fine. So may be fixed exception was the reason of the problem. I'll close this IZ as fixed. Please reopen it if will be wrong on you computer. Regards, Nick. fixed http://hg.netbeans.org/cnd-main?cmd=changeset;node=8c0953fca0a6
Nightly builds are available from http://bits.netbeans.org/download/trunk/nightly/latest/
Integrated into 'main-golden', will be available in build *200909190201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/8c0953fca0a6 User: Nick N. Krasilnikov <nnnnnk@netbeans.org> Log: fixing IZ#172419 : Model doesn't recognize class declared through the preprocessor
The fix does improve the recognition of the subclass(istream) member functions of filtering_stream but the 'push' member function is still not recognized. Please note that the push function is part of the standard interface to the filtering_stream class of the boost::iostreams library. It has nothing particular to do with my code. Consider this simpler example: #include <boost/iostreams/device/file_descriptor.hpp> #include <boost/iostreams/filtering_stream.hpp> namespace io = boost::iostreams; int main() { io::filtering_ostream out; out.push(file_sink("my_file.txt")); //unable to resolve identifier 'push' // write to out using std::ostream interface }
Thank you very much. Compilable (Sun Stusio) example: #include <boost/iostreams/device/file.hpp> #include <boost/iostreams/filtering_stream.hpp> namespace io = boost::iostreams; int main() { io::filtering_ostream out; out.push(io::file_sink("my_file.txt")); // push is unresolved }
Simple example: struct A { int i; }; template<typename T> struct B { typedef T type; }; template<typename T, typename Base = typename B<T>::type > struct C : public Base { }; int main() { C<A> c; c.i++; // unresolved }
I've fixed simple example. But there are another reason of the problem - partial evaluation of static constructions. And now we do not it. Example: template< bool C_ > struct bool_ { static const bool value = C_; }; typedef bool_<true> _true; template <bool i> class A { }; template <> struct A<true> { int i; }; int main() { A<_true::value> a; a.i++; // unresolved }
Alright. Well, at least there is progress? Out of curiosity are you planning to add this to the model at some point?
Yes, I'd like to add it. But I'm not sure that it will be implemented in 6.8. Do you know does some IDE already support partial evaluation?
partial fix: http://hg.netbeans.org/cnd-main?cmd=changeset;node=9f28196e9e22
Integrated into 'main-golden', will be available in build *200909301401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/9f28196e9e22 User: Nick N. Krasilnikov <nnnnnk@netbeans.org> Log: partly fixed IZ#172419 : Model doesn't recognize class declared through the preprocessor
Last sample is fixed. Problem is still here. So it's more common boost usage problem.
Sample from http://www.boost.org/doc/libs/1_46_1/doc/html/boost_asio/example/echo/blocking_tcp_echo_server.cpp a.accept is marked as unresolved identifier http://forums.netbeans.org/viewtopic.php?t=38327
last sample (unresolved a.accept) has different reasons. created another bug: http://netbeans.org/bugzilla/show_bug.cgi?id=198823
fixed under flags, because fix decreases performance (~30%). to enable provide: -J-Dcnd.modelimpl.expression.evaluator.deep.variable.provider=true -J-Dcnd.modelimpl.expression.evaluator.recursive.calc=true -J-Dcnd.modelimpl.expression.evaluator.extra.spec.params.matching=true http://hg.netbeans.org/releases/rev/8982adaea001