|
by: Bolin |
last post by:
Hi all,
A question about smart pointers of constant objects. The problem is to
convert from Ptr<T> to Ptr<const T>. I have look up and seen some
answers to this question, but I guess I am too stupid to understand
and make them work.
E.g. I have read that boost's smart pointers are able to do this
convertion, but the following code...
|
by: Michael Klatt |
last post by:
I am trying to write an iterator for a std::set that allows the
iterator target to be modified. Here is some relvant code:
template <class Set> // Set is an instance of std::set<>
class Iterator
{
public :
typedef typename Set::value_type T;
typedef typename Set::iterator SetIterator;
Iterator(Set& container, const SetIterator& it);
|
by: NKOBAYE027 |
last post by:
Hi Everyone:
Short description first
MathematicalSet is to be a class template that's supposed to behave as the
name suggests. It has functions that define union, contains,
is_contained_in, etc... I want the thing to behave like a normal collection
as well. That is to comply with the ansi standard for STL collections even
though it...
|
by: James Gregory |
last post by:
#include <cstdlib>
#include <cctype>
#include <string>
template <class Input_Iter>
inline int IterToInt(Input_Iter& iter, const Input_Iter& lineEnd) {
char tempArray = {0};
for (int i = 0; std::isdigit(*iter) && iter != lineEnd && i != 80;
++i) {
tempArray = *iter;
|
by: Old Wolf |
last post by:
Hi all. G++ fails to compile the following:
#include <string>
int main()
{
std::string foo("abc=123");
std::string::const_iterator delimiter
= std::find(foo.begin(), foo.end(), '=');
|
|
by: vsgdp |
last post by:
Hi,
Is the reason for supplying both const and non-const iterators so that you
can still traverse a const container for reading. The compiler knows to
call the const version if the object is const?
|
by: Lorenzo Castelli |
last post by:
This is an old problem of mine.
Basically I have an abstract base class which represents a generic iterator
over a collection of elements, and various derived classes that implement
the traversing on specific data structures.
For each iterator I want to be able to specify the four possible const
combinations, corresponding to the various ...
|
by: kotau |
last post by:
Hi,
I'm having trouble with something that would appear to have a simple
solution.
Here's a version of the code I'm working with:
const Item* p 0;
name::const_iterator i;
|
by: miaohua1982 |
last post by:
the program is as follows:
#include <vector>
using namespace std;
class A{};
int main()
{
A* const &p = NULL;
vector<A*B(3,NULL); //there is a compile error
B.push_back(NULL);
|
by: wellingj |
last post by:
A little back ground on what I'm trying to do: I'm making a generic weighted graph class (vertexes and edges althought I don't call them that) to implement some pathfinding algorithms like A* and D*. I am also going to compare a grid map to a hex map, which is why I want to make a generic base graph class that gridmap and hexmap will inherit from....
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
|