Click here to Skip to main content
15,926,174 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: DECLARE_CLASSFACTORY_SINGLETON Problem Pin
Dudi Avramov22-Sep-03 2:53
Dudi Avramov22-Sep-03 2:53 
GeneralRe: DECLARE_CLASSFACTORY_SINGLETON Problem Pin
Braulio Dez22-Sep-03 5:13
Braulio Dez22-Sep-03 5:13 
GeneralRe: DECLARE_CLASSFACTORY_SINGLETON Problem Pin
sashaf23-Sep-03 2:29
sashaf23-Sep-03 2:29 
GeneralRe: DECLARE_CLASSFACTORY_SINGLETON Problem Pin
Braulio Dez23-Sep-03 2:46
Braulio Dez23-Sep-03 2:46 
GeneralWell... it can be possible but then you are making something wrong... Pin
Braulio Dez23-Sep-03 3:18
Braulio Dez23-Sep-03 3:18 
GeneralRe: Well... it can be possible but then you are making something wrong... Pin
umarcool23-Sep-03 5:42
umarcool23-Sep-03 5:42 
GeneralUsing for_each with a map Pin
John M. Drescher20-Sep-03 9:53
John M. Drescher20-Sep-03 9:53 
GeneralRe: Using for_each with a map Pin
ZoogieZork20-Sep-03 12:11
ZoogieZork20-Sep-03 12:11 
Unfortunately, you'll need to use the non-standard select1st and compose1 functions (AFAIK). VS.NET 2K3 doesn't support either function out of the box, but other STL implementations do (they are SGI extensions).

Here's an example using GCC 3.x:

<br />
#include <map><br />
#include <algorithm><br />
#include <functional><br />
#include <ext/functional><br />
<br />
using namespace std;<br />
using namespace __gnu_cxx;<br />
<br />
typedef map<int,int> pool_t;<br />
<br />
void Process(int i) {<br />
  printf("%d\n",i);<br />
}<br />
<br />
int main(int argc,char **argv) {<br />
  pool.insert(pool_t::value_type(1,2));<br />
  pool.insert(pool_t::value_type(5,2));<br />
  pool.insert(pool_t::value_type(3,2));<br />
  pool.insert(pool_t::value_type(2,2));<br />
<br />
  for_each(pool.begin(),pool.end(),<br />
    compose1(ptr_fun(Process),<br />
      select1st<pool_t::value_type>()));<br />
<br />
    return 0;<br />
}<br />


Of course, it's a bit dubious as to whether this is really any easier to work with than writing your own iteration loop.

If there's another way to accomplish this without using the extensions, I'd love to know Smile | :)

- Mike
GeneralRe: Using for_each with a map Pin
John M. Drescher20-Sep-03 18:40
John M. Drescher20-Sep-03 18:40 
GeneralRe: Using for_each with a map Pin
Phil Martin23-Sep-03 20:26
professionalPhil Martin23-Sep-03 20:26 
GeneralRe: Using for_each with a map Pin
John M. Drescher24-Sep-03 3:51
John M. Drescher24-Sep-03 3:51 
Generaldcom local server marshalling. Pin
umarcool19-Sep-03 2:30
umarcool19-Sep-03 2:30 
GeneralRe: dcom local server marshalling. Pin
Gary R. Wheeler20-Sep-03 5:29
Gary R. Wheeler20-Sep-03 5:29 
GeneralProblem with remote server Pin
umarcool21-Sep-03 19:14
umarcool21-Sep-03 19:14 
GeneralRe: Problem with remote server Pin
Gary R. Wheeler22-Sep-03 14:15
Gary R. Wheeler22-Sep-03 14:15 
GeneralRe: Problem with remote server Pin
umarcool23-Sep-03 5:44
umarcool23-Sep-03 5:44 
GeneralATL COM Pin
Binayak18-Sep-03 13:07
Binayak18-Sep-03 13:07 
GeneralRe: ATL COM Pin
Braulio Dez22-Sep-03 5:15
Braulio Dez22-Sep-03 5:15 
QuestionHow do you catch Dialog Boxes from a Browser Help Object (BHO) Pin
RickGavin18-Sep-03 7:26
RickGavin18-Sep-03 7:26 
GeneralATL 7.0 COM Object Deployment Pin
Braulio Dez18-Sep-03 4:36
Braulio Dez18-Sep-03 4:36 
QuestionHow to release memory? when calling COM with param type BSTR* from VB exe application Pin
doisy18-Sep-03 2:30
doisy18-Sep-03 2:30 
AnswerRe: How to release memory? when calling COM with param type BSTR* from VB exe application Pin
Braulio Dez18-Sep-03 4:41
Braulio Dez18-Sep-03 4:41 
AnswerRe: How to release memory? when calling COM with param type BSTR* from VB exe application Pin
Tom Welch18-Sep-03 5:15
Tom Welch18-Sep-03 5:15 
GeneralOffice::CommandBarControl problem Pin
dorutzu17-Sep-03 4:19
dorutzu17-Sep-03 4:19 
GeneralAn Outlook Addin issue Pin
dorutzu16-Sep-03 12:06
dorutzu16-Sep-03 12:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.