Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Utf8Array] デフォルトコンストラクターをエラーにする #100

Merged
merged 1 commit into from
Nov 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Source/Utf8Utility/Utf8Array.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Text;
using Microsoft.Toolkit.HighPerformance;
Expand Down Expand Up @@ -27,6 +28,12 @@ namespace Utf8Utility;
{
readonly byte[] _value;

[Obsolete("Do not use default constructor.", true)]
[EditorBrowsable(EditorBrowsableState.Never)]
#pragma warning disable
public Utf8Array() => throw new NotSupportedException();
#pragma warning restore

/// <summary>
/// <see cref="Utf8Array"/>構造体の新しいインスタンスを取得します。
/// </summary>
Expand Down