Ticket #27703

fixed_string::end_がbegin_を指している

Open Date: 2012-02-27 21:53 Last Update: 2012-04-15 22:30

Reporter:
Owner:
Type:
Status:
Closed
Component:
(None)
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Won't Fix
File:
None

Details

fixed_string::end_がbegin_の先頭を指し示しています.そのため,fixed_string::str()が失敗します.

コンストラクタで

end_(begin_)
と初期化しているのが原因です.
end_(begin_ + LENGTH)
とすべきです.

Ticket History (3/3 Histories)

2012-02-27 21:53 Updated by: uchan_nos
  • New Ticket "fixed_string::end_がbegin_を指している" created
2012-03-08 00:08 Updated by: ousttrue
Comment

たぶん仕様です。 buf長はLENGTHだけど中身は、0長文字列という意図です。

cygwin gcc

#include "src/text.h"
#include <iostream>

int main(int argc, char **argv)
{
auto a=meshio::fixed_string<10>();
std::cout << '[' << a.str() << ']' << std::endl;

reutrn 0;
}

g++ -D_WINDOWS -std=c++0x exp.cpp

で特に問題なかったです。 何か都合の悪いシチュエーションがある場合知らせてもらえれば、仕様を変えられます。

2012-04-15 22:30 Updated by: ousttrue
  • Resolution Update from None to Won't Fix
  • Status Update from Open to Closed
  • Ticket Close date is changed to 2012-04-15 22:30

Attachment File List

No attachments

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login