Monday, March 10, 2014

Basic Types

Newsgroup: comp.lang.c++

Subject: Basic Types

From: nvangogh <nvangogh@...>

Date: Mon, 10 Mar 2014 17:42:10 +0000



Is it fair (and technically accurate) to say that the only differences

between int, long, long long and short is the number of bits that is

required to represent the type in the computer? Or is there additional

differences than size?







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1neFJoD

View all the progranning help forums at:

http://ift.tt/1dP9txN

Which one(s) of the following std::vector's member functions has the possibility/authority to reduce a vector's capacity?

Newsgroup: comp.lang.c++

Subject: Which one(s) of the following std::vector's member functions has the possibility/authority to reduce a vector's capacity?

From: goodbyeera@...

Date: Sun, 9 Mar 2014 19:11:23 -0700 (PDT)



Which one(s) of the following std::vector's member functions has the possibility/authority to reduce a vector's capacity?



I have 5 member functions in question:

template <class T, class Allocator = allocator<T> >

class vector {

public:

vector<T,Allocator>& operator=(const vector<T,Allocator>& x);

vector<T,Allocator>& operator=(vector<T,Allocator>&& x);

vector& operator=(initializer_list<T>);

void assign(initializer_list<T>);

void clear() noexcept;

};



Notes:

- For assignments: Unlike vector::swap() which explicitly specifies exchanging both contents and capacity, I can't find reliable answers for the various forms of assignments.

- For std::assign(), there are 2 other overloads:

template <class InputIterator> void assign(InputIterator first, InputIterator last);

void assign(size_type n, const T& u);

And they are both explicitly defined in terms of calls to erase() and insert(), so it's guaranteed with no reduce in capacity. But for the overload taking an initializer_list as the argument, I can't find a reliable answer.

- For std::clear(), in C++03, it's explicitly defined in terms of erase(begin(),end()), so it's guaranteed with no reduce in capacity. I can't find equivalent definition in C++11 anymore.



Relevant excerpts from the standard are highly appreciated.



Thanks,

Goodbyeera







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/NRcatl

View all the progranning help forums at:

http://ift.tt/1dP9txN

Saturday, March 8, 2014

Speech Recognition for Neural diseases Persons

Newsgroup: comp.lang.c++

Subject: Speech Recognition for Neural diseases Persons

From: almostcash@...

Date: Sat, 8 Mar 2014 05:08:36 -0800 (PST)



I am making a speech recognition program in C++ for for neural disease person.



the program should take input from the mic and convert the speech into text.



i have tried the microsoft sapi and other normal speech reconition api, however it just doesnt work in my case.



the persons i am talking about they cant prounounce the words properly. they can only speak few words clearly.



so i need an api or something which could use the limited vocablary option in order to convert speech into text.



thats the only way i think to make this work to be done properly.







suggestion needed







thanks









via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1hVPoe3

View all the progranning help forums at:

http://ift.tt/1dP9txN

Tuesday, March 4, 2014

Brand new C++ container released

Newsgroup: comp.lang.c++

Subject: Brand new C++ container released

From: Mr Flibble <flibbleREMOVE_THIS_AND_THIS@...>

Date: Wed, 05 Mar 2014 00:41:37 +0000



A brand new C++ container called "segmented_array" has been released

which offers fast insert/erase anywhere in a controlled sequence:



http://ift.tt/1f4Vl3V



It performs better than its closest competition (avl_array).



Example timings:



std::vector random erase: 17.1273 seconds

std::deque random erase: 17.6862 seconds

std::list random erase: 24.1854 seconds

mkr::avl_array random erase: 0.1263 seconds

neolib::segmented_array (1) random erase: 0.3113 seconds

neolib::segmented_array (2) random erase: 0.1370 seconds

neolib::segmented_array (3) random erase: 0.1206 seconds

neolib::segmented_array (4) random erase: 0.1198 seconds

std::vector random insert: 73.9902 seconds

std::deque random insert: 25.0955 seconds

std::list random insert: 52.6922 seconds

mkr::avl_array random insert: 0.1513 seconds

neolib::segmented_array (1) random insert: 0.2608 seconds

neolib::segmented_array (2) random insert: 0.1170 seconds

neolib::segmented_array (3) random insert: 0.1158 seconds

neolib::segmented_array (4) random insert: 0.1636 seconds

std::vector random access: 0.0055 seconds

std::deque random access: 0.0095 seconds

std::list random access: 60.9293 seconds

mkr::avl_array random access: 0.0850 seconds

neolib::segmented_array (1) random access: 0.1100 seconds

neolib::segmented_array (2) random access: 0.0470 seconds

neolib::segmented_array (3) random access: 0.0352 seconds

neolib::segmented_array (4) random access: 0.0278 seconds

std::vector sequential access: 0.0019 seconds

std::deque sequential access: 0.0026 seconds

std::list sequential access: 0.0133 seconds

mkr::avl_array sequential access: 0.0138 seconds

neolib::segmented_array (1) sequential access: 0.0180 seconds

neolib::segmented_array (2) sequential access: 0.0032 seconds

neolib::segmented_array (3) sequential access: 0.0028 seconds

neolib::segmented_array (4) sequential access: 0.0027 seconds

std::vector sort: 0.0242 seconds

std::deque sort: 0.0491 seconds

std::list sort: 0.0980 seconds

mkr::avl_array sort: 0.7306 seconds

neolib::segmented_array (1) sort: 0.6190 seconds

neolib::segmented_array (2) sort: 0.0579 seconds

neolib::segmented_array (3) sort: 0.0494 seconds

neolib::segmented_array (4) sort: 0.0452 seconds



/Flibble







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1hICWiq

View all the progranning help forums at:

http://ift.tt/1dP9txN

Thursday, February 27, 2014

calling placement new for elements of a deque

Newsgroup: comp.lang.c++

Subject: calling placement new for elements of a deque

From: hbdevelop1@...

Date: Wed, 26 Feb 2014 21:50:29 -0800 (PST)



Hello

For optimisation reasons, I am re-using not used objects in my deque for new objects.

I am doing that this way :

void Score::Add(const char *str, Coordinates &sp)

{

for(deque<Text>::iterator it=scores.begin();it!=scores.end(); ++it)

{

if(it->notUsed==1)

{

it->Reset(str,sp);

return;

}

}



scores.push_back(Text(str,sp));

}



I thought it would be more convenient to call the placement new on the notUsed object instead of Reset.

How can I do this ?

How can I get the address of the not used object so I can use it in the new placement operator?





Thank you in advance







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1cWtAxS

View all the progranning help forums at:

http://ift.tt/1dP9txN

How to download Microsoft Visuail c++ software

Newsgroup: comp.lang.c++

Subject: How to download Microsoft Visuail c++ software

From: 893756098a@...

Date: Tue, 25 Feb 2014 20:22:02 -0800 (PST)



Recently,our class had studied Microsoft Visuail c++.So I want to practice after school,but I can't install this.I would appreciate it if someone could do me a favour!







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/1cWtAxC

View all the progranning help forums at:

http://ift.tt/1dP9txN

Sunday, February 23, 2014

hw to get started

Newsgroup: comp.lang.c++

Subject: hw to get started

From: erson212 <erson212@...>

Date: Sun, 23 Feb 2014 01:20:06 -0800 (PST)



Please can some 1 tell me hw to get started with c++, first tin to du







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://ift.tt/MlsTUe

View all the progranning help forums at:

http://ift.tt/1dP9txN