Click here to Skip to main content
15,919,341 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Access Driver in Embedded Standard OS Pin
Munchies_Matt6-Jul-17 6:44
Munchies_Matt6-Jul-17 6:44 
GeneralRe: Access Driver in Embedded Standard OS Pin
divya036-Jul-17 22:36
divya036-Jul-17 22:36 
GeneralRe: Access Driver in Embedded Standard OS Pin
Munchies_Matt7-Jul-17 0:25
Munchies_Matt7-Jul-17 0:25 
GeneralRe: Access Driver in Embedded Standard OS Pin
Randor 10-Jul-17 9:00
professional Randor 10-Jul-17 9:00 
QuestionRe: Access Driver in Embedded Standard OS Pin
David Crow6-Jul-17 4:34
David Crow6-Jul-17 4:34 
AnswerRe: Access Driver in Embedded Standard OS Pin
divya036-Jul-17 22:38
divya036-Jul-17 22:38 
GeneralRe: Access Driver in Embedded Standard OS Pin
Frederick J. Harris10-Jul-17 3:28
Frederick J. Harris10-Jul-17 3:28 
AnswerRe: Access Driver in Embedded Standard OS Pin
Randor 10-Jul-17 8:47
professional Randor 10-Jul-17 8:47 
QuestionHow to run a java script(json) from my vc++ code? Pin
pankajkumar4-Jul-17 2:25
pankajkumar4-Jul-17 2:25 
SuggestionRe: How to run a java script(json) from my vc++ code? Pin
Richard MacCutchan4-Jul-17 2:56
mveRichard MacCutchan4-Jul-17 2:56 
GeneralRe: How to run a java script(json) from my vc++ code? Pin
pankajkumar4-Jul-17 19:36
pankajkumar4-Jul-17 19:36 
GeneralRe: How to run a java script(json) from my vc++ code? Pin
Richard MacCutchan4-Jul-17 21:29
mveRichard MacCutchan4-Jul-17 21:29 
GeneralRe: How to run a java script(json) from my vc++ code? Pin
pankajkumar4-Jul-17 19:38
pankajkumar4-Jul-17 19:38 
GeneralRe: How to run a java script(json) from my vc++ code? Pin
pankajkumar4-Jul-17 19:42
pankajkumar4-Jul-17 19:42 
QuestionRe: How to run a java script(json) from my vc++ code? Pin
David Crow5-Jul-17 2:22
David Crow5-Jul-17 2:22 
AnswerRe: How to run a java script(json) from my vc++ code? Pin
pankajkumar5-Jul-17 3:08
pankajkumar5-Jul-17 3:08 
QuestionHelp with .lib for STD::COUT Pin
ForNow2-Jul-17 16:28
ForNow2-Jul-17 16:28 
AnswerRe: Help with .lib for STD::COUT Pin
Richard MacCutchan2-Jul-17 21:58
mveRichard MacCutchan2-Jul-17 21:58 
AnswerRe: Help with .lib for STD::COUT Pin
leon de boer4-Jul-17 2:54
leon de boer4-Jul-17 2:54 
GeneralRe: Help with .lib for STD::COUT Pin
ForNow4-Jul-17 3:38
ForNow4-Jul-17 3:38 
GeneralRe: Help with .lib for STD::COUT Pin
Randor 5-Jul-17 2:42
professional Randor 5-Jul-17 2:42 
GeneralRe: Help with .lib for STD::COUT Pin
ForNow5-Jul-17 3:12
ForNow5-Jul-17 3:12 
AnswerRe: Help with .lib for STD::COUT Pin
Randor 5-Jul-17 3:20
professional Randor 5-Jul-17 3:20 
QuestionSimple question about templates Pin
Richard MacCutchan2-Jul-17 5:25
mveRichard MacCutchan2-Jul-17 5:25 
I have a templated class that is based on string or wstring, and most things are easy as the basic_string contains sufficient operators and methods to manipulate the text. However, one thing I cannot get round is including character constants inside the template, as below:
C++
template <typename T>
class Tokenizer
{
    typedef typename T::size_type _Mysizt;
    T strText;
    T strFilter;
    
    _Mysizt offset;	// offset of the current substring (token)
    _Mysizt index;	// index to the next separator character, or npos if not found
    _Mysizt length;	// length of the current substring, or npos if the last one
    
    public:
    Tokenizer(T strText, T strFilter)
    {
        // code removed for readability
    }
    
    T Next(bool bTrim)
    {
        T strToken;
        if (bTrim)
        {
            // trim leading spaces
// but ' ' will not be accepted for a wstring, and L' ' will not be for a string
            offset = strText.find_first_not_of(' ', offset);
        }
        // code removed for readability
    }
    return strToken;
}


I am sure it must be possible (OG, Po'H, SB), but my reading of the documentation and samples has not helped. So what (obvious) did I miss?

[edit]
While David Crow's suggestion works for a character constant, it will not work for a string like:
C++
offset = strText.find_first_not_of(" \t", offset);

[/edit]

modified 3-Jul-17 4:43am.

QuestionRe: Simple question about templates Pin
David Crow2-Jul-17 17:44
David Crow2-Jul-17 17:44 

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.